Class CollectionUtil
java.lang.Object
org.apache.tinkerpop.gremlin.util.CollectionUtil
Utility class for working with collections and arrays.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]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> 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 Details
-
asList
Converts varargs to aList. -
asSet
Converts varargs to aSet. -
asSet
ConvertsCollectionto aSet. -
asMap
Converts varargs to aMapwhere the elements are key/value pairs. -
clone
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. -
addFirst
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.
-