Java Utililty Methods List Unmodifiable

List of utility methods to do List Unmodifiable

Description

The list of methods to do List Unmodifiable are organized into topic(s).

Method

ListaddMappedUnmodifiableListEntry(Map> map, K key, V value)
When you have a map containing values that are array lists of a specific type...
List<V> list = map.get(key);
if (list == null)
    list = new ArrayList<V>();
else
    list = new ArrayList<V>(list);
list.add(value);
list = Collections.unmodifiableList(list);
map.put(key, list);
...
ListnullTolerantUnmodifiableList(List l)
null Tolerant Unmodifiable List
return l == null ? Collections.<T>emptyList() : Collections.unmodifiableList(l);
ListtoUnmodifiableList(CharSequence... sequences)
to Unmodifiable List
if (sequences == null || sequences.length == 0) {
    return Collections.emptyList();
return Collections.unmodifiableList(Arrays.asList(sequences));
ListtoUnmodifiableList(T[] array)
to Unmodifiable List
return Collections.unmodifiableList(toList(array));