Package ch.rasc.wamp2spring.util
Class CollectionHelper
java.lang.Object
ch.rasc.wamp2spring.util.CollectionHelper
Collection helper class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoList(Collection<T> collection) Converts an arbitraryCollectionto aList.static <T> List<T>toList(T... arguments) Converts a vararg argument to aList.toSet(Collection<Long> collection) Converts an arbitraryCollectionto aSet.
-
Constructor Details
-
CollectionHelper
public CollectionHelper()
-
-
Method Details
-
toList
Converts a vararg argument to aList.- Parameters:
arguments- variable number of instances- Returns:
- a
Listinstance with the provided arguments
-
toList
Converts an arbitraryCollectionto aList.Returns the same object if the provided parameter is already an instance of
List.- Parameters:
collection- an arbitrary instance ofCollection- Returns:
- an instance of
Listcontaining all the elements of the provided collection
-
toSet
Converts an arbitraryCollectionto aSet. Removes duplicates.- Parameters:
collection- an arbitrary instance ofCollection- Returns:
- an instance of
Setcontaining all the elements of the provided collection.
-