Class UnmodifiableCollections
java.lang.Object
org.spongepowered.configurate.util.UnmodifiableCollections
Provides a set of methods that produce unmodifiable copies of collections.
- Since:
- 4.0.0
- 
Method SummaryModifier and TypeMethodDescriptionstatic <K,V> Map<K, V> Build an unmodifiable map.static <E> List<E>Creates an unmodifiable copy of the givenListinstance.static <K,V> Map<K, V> Creates an unmodifiable copy of the givenMapinstance.static <E> Set<E>Creates an unmodifiable copy of the givenSetinstance.static <K,V> Map.Entry<K, V> immutableMapEntry(K key, V value) Creates an immutable instance ofMap.Entry.static <E> List<E>toList(E... original) Creates an unmodifiable copy of the given array as a list, preserving order.static <E> Set<E>toSet(E... original) Creates an unmodifiable copy of the given array as a set.
- 
Method Details- 
copyOfCreates an unmodifiable copy of the givenListinstance.- Type Parameters:
- E- the type of every item in the entry
- Parameters:
- original- the list to be copied
- Returns:
- a unmodifiable copy of the given Listinstance
- Since:
- 4.0.0
 
- 
copyOfCreates an unmodifiable copy of the givenSetinstance.- Type Parameters:
- E- the type of every item in the entry
- Parameters:
- original- the set to be copied
- Returns:
- a unmodifiable copy of the given Setinstance
- Since:
- 4.0.0
 
- 
copyOfCreates an unmodifiable copy of the givenMapinstance.- Type Parameters:
- K- key type of the map
- V- value type of the map
- Parameters:
- original- the map to be copied
- Returns:
- an unmodifiable copy of the given Mapinstance.
- Since:
- 4.1.0
 
- 
toListCreates an unmodifiable copy of the given array as a list, preserving order.- Type Parameters:
- E- the type of every item in the entry
- Parameters:
- original- the array to be copied into a list
- Returns:
- a unmodifiable copy of the given array as a Listinstance
- Since:
- 4.0.0
 
- 
toSetCreates an unmodifiable copy of the given array as a set.- Type Parameters:
- E- the type of every item in the entry
- Parameters:
- original- the array to be copied into a set
- Returns:
- a unmodifiable copy of the given array as a Setinstance
- Since:
- 4.0.0
 
- 
buildMapBuild an unmodifiable map.- Type Parameters:
- K- key type
- V- value type
- Parameters:
- handler- consumer that will populate the map wih keys
- Returns:
- a new unmodifiable map
- Since:
- 4.0.0
 
- 
immutableMapEntryCreates an immutable instance ofMap.Entry.- Type Parameters:
- K- the key's type
- V- the value's type
- Parameters:
- key- the key in the entry
- value- the value in the entry
- Returns:
- the new map entry
- Since:
- 4.0.0
 
 
-