Java List to Map listToMap(List input)

Here you can find the source of listToMap(List input)

Description

list To Map

License

Apache License

Declaration

private static Map<String, Object> listToMap(List input) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    private static Map<String, Object> listToMap(List input) {
        int sz = input.size();
        Map<String, Object> output = new LinkedHashMap<>();
        for (int i = 0; i < sz; i++) {
            output.put("idx_" + i, input.get(i));
        }//from   w w w  . j  av  a2 s  .c o  m

        return output;

    }
}

Related

  1. listToMap(final String... strings)
  2. listToMap(List> list)
  3. listToMap(List> list)
  4. listToMap(Object... objects)