Class CollectionUtils
java.lang.Object
jdk.jpackage.internal.util.CollectionUtils
This class consists exclusively of static methods that operate on or return collections.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends B,
B, C extends Collection<T>>
CtoCollection
(Collection<B> v) Casts the given collection to the requested type.static <T extends B,
B, C extends Collection<T>>
CtoCollectionUBW
(Collection<? extends B> v) Casts the given collection to the requested upper bounded wildcard (UBW) type.static <T> Set
<T> toSet
(Collection<T> col) Converts the given collection toSet
.
-
Constructor Details
-
CollectionUtils
public CollectionUtils()
-
-
Method Details
-
toCollection
Casts the given collection to the requested type.- Type Parameters:
T
- the type of elements in this output collectionB
- the type of elements in this input collectionC
- the output collection type- Parameters:
v
- the input collection. Null is permitted.- Returns:
- the input collection cast to the requested type
-
toCollectionUBW
public static <T extends B,B, C toCollectionUBWC extends Collection<T>> (Collection<? extends B> v) Casts the given collection to the requested upper bounded wildcard (UBW) type.- Type Parameters:
T
- the type of elements in this output collectionB
- the upper bound type of elements in this input collectionC
- the output collection type- Parameters:
v
- the input collection. Null is permitted.- Returns:
- the input collection cast to the requested type
-
toSet
Converts the given collection toSet
.
-