Transform principal attributes list into map map.

@param list the list
@return the map
777829
public static Map<String, Object> transformPrincipalAttributesListIntoMap(final List<String> list) {
        val map = transformPrincipalAttributesListIntoMultiMap(list);
        return CollectionUtils.wrap(map);
    }
897359
static public LinkedHashMap<String,FeatureList> buildFeatureAtrributeIndex(String attribute,FeatureList list){

		LinkedHashMap<String,FeatureList> featureHashMap = new LinkedHashMap<String,FeatureList>();
		FeatureList featureList = list.selectByAttribute(attribute);
		for(FeatureI feature : featureList){
			String value = feature.getAttribute(attribute);
			FeatureList features = featureHashMap.get(value);
			if(features == null){
				features = new FeatureList();
				featureHashMap.put(value, features);
			}
			features.add(feature);
		}

		return featureHashMap;
	}
59808
@Override
    public Object mapFromAttributes(final Attributes attributes) throws NamingException {
        final int attributeCount = attributes.size();
        final Map<String, Object> mapOfAttrValues = this.createAttributeMap(attributeCount);

        for (final NamingEnumeration<? extends Attribute> attributesEnum = attributes.getAll(); attributesEnum.hasMore(); ) {
            final Attribute attribute = attributesEnum.next();

            if (!this.ignoreNull || attribute.size() > 0) {
                final String attrName = attribute.getID();
                final String key = this.getAttributeKey(attrName);

                final NamingEnumeration<?> valuesEnum = attribute.getAll();
                final List<?> values = this.getAttributeValues(valuesEnum);

                mapOfAttrValues.put(key, values);
            }
        }

        return mapOfAttrValues;
    }
1092760
@Override
    public C.List<T> prepend(C.List<T> list) {
        return prependList(list);
    }
355918
@JsonIgnore
    protected Map<String, List<Object>> getCachedPrincipalAttributes(final Principal principal, final RegisteredService registeredService) {
        try {
            val cache = getCacheInstanceFromApplicationContext();
            return cache.getCachedAttributesFor(registeredService, this, principal);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return new HashMap<>(0);
    }
548752
public static <S, D> List<D> mapList(Iterable<S> sourceList, Class<D> destinationClass) {
		List<D> destinationList = new ArrayList<D>();
		for (S source : sourceList) {
			if (source != null) {
				destinationList.add(mapper.map(source, destinationClass));
			}
		}
		return destinationList;
	}
298633
@Override
    public Map<String, List<Object>> getAttributes() {
        for (final IAdditionalDescriptors additionalDescriptors : delegateDescriptors) {
            final Map<String, List<Object>> attributes = additionalDescriptors.getAttributes();
            if (attributes != null && !attributes.isEmpty()) {
                return attributes;
            }
        }

        return Collections.emptyMap();
    }
1141527
@Override
    public Map<String, List<Object>> getAttributeMap() {
        final Map<String, List<Object>> attrMap = userAttributes;
        return attrMap;
    }
574428
private static List<Integer> convertList(List<String> list) {
        if (list == null) {
            return null;
        }
        List<Integer> ret = new ArrayList<Integer>(list.size());
        for (String v : list) {
            ret.add(StringUtils.toInt(v));
        }

        return ret;
    }
1314644
public static Object toArray(Object list, Class<?> clazz) {
        if (list == null)
            return Array.newInstance(clazz, 0);

        if (list instanceof List) {
            List<?> l = (List<?>) list;
            if (clazz.isPrimitive()) {
                Object a = Array.newInstance(clazz, l.size());
                for (int i = 0; i < l.size(); i++)
                    Array.set(a, i, l.get(i));
                return a;
            }
            return l.toArray((Object[]) Array.newInstance(clazz, l.size()));

        }

        Object a = Array.newInstance(clazz, 1);
        Array.set(a, 0, list);
        return a;
    }
1066163
public <T extends ValueMap> List<T> getList(Object key, Class<T> clazz) {
    Object value = get(key);
    if (value instanceof List) {
      List list = (List) value;
      try {
        ArrayList<T> real = new ArrayList<>();
        for (Object item : list) {
          T typedValue = coerceToValueMap(item, clazz);
          if (typedValue != null) {
            real.add(typedValue);
          }
        }
        return real;
      } catch (Exception ignored) {
      }
    }
    return null;
  }
1115373
public static String arrayListToCSV(List<String> list) {
        StringBuilder csv = new StringBuilder();
        for (String str : list) {
            csv.append(str);
            csv.append(",");
        }
        int lastIndex = csv.length() - 1;
        char last = csv.charAt(lastIndex);
        if (last == ',') {
            return csv.substring(0, lastIndex);
        }
        return csv.toString();
    }
183249
public static List<HistoryDTO> transformToDto(List<History> list) {
        if (list == null) {
            throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
        }

        List<HistoryDTO> result = new ArrayList<HistoryDTO>();

        for (History history : list) {
            result.add(transformToDto(history));
        }
        return result;
    }
397574
protected Map<String, List<Object>> convertAttributesToPrincipalAttributesAndCache(final Principal principal,
                                                                                       final Map<String, List<Object>> sourceAttributes,
                                                                                       final RegisteredService registeredService) {
        val finalAttributes = convertPersonAttributesToPrincipalAttributes(sourceAttributes);
        addPrincipalAttributes(principal.getId(), finalAttributes, registeredService);
        return finalAttributes;
    }
186694
private Map<String, ChatConversationBase> makeMapFromSavedConversations(List<ChatConversationBase> list) {

        Map<String, ChatConversationBase> map = new HashMap<>();

        if (list != null && !list.isEmpty()) {
            for (ChatConversationBase details : list) {
                map.put(details.getConversationId(), details);
            }
        }

        return map;
    }
1233852
protected Map<String, Map<Integer, Set<String>>> createUpdateList() {
    Map<String, Map<Integer, Set<String>>> updateList = new HashMap<>();
    updateList.put(UPDATE_TYPE_OFFSET, new HashMap<>());
    updateList.put(UPDATE_TYPE_POSITION, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_START, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_END, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_START, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_END, new HashMap<>());
    updateList.put(UPDATE_TYPE_VARIABLE, new HashMap<>());
    return updateList;
  }
704263
private void mapAttributes(List<Attribute> input, Map<String, List<Attribute>> output) {
        Iterator<Attribute> it = input.iterator();
        while (it.hasNext()) {
            Attribute attr = it.next();
            String id = attr.getId().toString();

            if (output.containsKey(id)) {
                List<Attribute> list = output.get(id);
                list.add(attr);
            } else {
                List list = new ArrayList<Attribute>();
                list.add(attr);
                output.put(id, list);
            }
        }
    }