Class CollectionUtil
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.util.CollectionUtil
 
- 
 public final class CollectionUtil extends Object Utility class for working with collections and arrays.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T[]addFirst(T[] array, T element, Class<T> clazz)Adds the element argument to the start of the supplied array argument, but if the array is null then return the element as a new array with just that item in it.static <E> List<E>asList(E... elements)Converts varargs to aList.static <K,V>
 LinkedHashMap<K,V>asMap(Object... elements)Converts varargs to aMapwhere the elements are key/value pairs.static <E> LinkedHashSet<E>asSet(E... elements)Converts varargs to aSet.static <E> LinkedHashSet<E>asSet(Collection<E> elements)ConvertsCollectionto aSet.static <K,V>
 ConcurrentHashMap<K,V>clone(ConcurrentHashMap<K,V> map)Clones a givenConcurrentHashMapby creating a new map and copying all entries from the original map.
 
- 
- 
- 
Method Detail- 
asListpublic static <E> List<E> asList(E... elements) Converts varargs to aList.
 - 
asSetpublic static <E> LinkedHashSet<E> asSet(E... elements) Converts varargs to aSet.
 - 
asSetpublic static <E> LinkedHashSet<E> asSet(Collection<E> elements) ConvertsCollectionto aSet.
 - 
asMappublic static <K,V> LinkedHashMap<K,V> asMap(Object... elements) Converts varargs to aMapwhere the elements are key/value pairs.
 - 
clonepublic static <K,V> ConcurrentHashMap<K,V> clone(ConcurrentHashMap<K,V> map) Clones a givenConcurrentHashMapby creating a new map and copying all entries from the original map. If the value of an entry is aSetor anArrayList, a deep copy of the value is created. Otherwise, the value is copied as is.
 - 
addFirstpublic static <T> T[] addFirst(T[] array, T element, Class<T> clazz)Adds the element argument to the start of the supplied array argument, but if the array is null then return the element as a new array with just that item in it.
 
- 
 
-