Package com.skava.auth.util
Class JavaCollectionUtil
java.lang.Object
com.skava.auth.util.JavaCollectionUtil
- Direct Known Subclasses:
UtilBase
THis class holds the utility methods related to java collections.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> List<T>
convertToList
(Collection<T> collection) This method returns the list from any type of collection.protected static <T> List<T>
THis method returns the new ArrayList.protected static <T> Set<T>
This method returns the new HashSet.protected static <K,
V> boolean hasSingleKey
(Map<K, V> map, K key) This method validates the given map has given element or not.
-
Constructor Details
-
JavaCollectionUtil
protected JavaCollectionUtil()default constructor.
-
-
Method Details
-
getNewSet
This method returns the new HashSet.- Type Parameters:
T
- type of the set's data.- Returns:
- a new
HashSet
object.
-
getNewList
THis method returns the new ArrayList.- Type Parameters:
T
- type of the list's data.- Returns:
- a new
ArrayList
object.
-
hasSingleKey
This method validates the given map has given element or not. -
convertToList
This method returns the list from any type of collection.- Type Parameters:
T
- type of the collection's data.- Parameters:
collection
- aCollection
object.- Returns:
- a
List
of given collection data objects.
-