Class JavaCollectionUtil

java.lang.Object
com.skava.auth.util.JavaCollectionUtil
Direct Known Subclasses:
UtilBase

public class JavaCollectionUtil extends Object
THis class holds the utility methods related to java collections.
Author:
Infosys Equinox
  • Constructor Details

    • JavaCollectionUtil

      protected JavaCollectionUtil()
      default constructor.
  • Method Details

    • getNewSet

      protected static <T> Set<T> getNewSet()
      This method returns the new HashSet.
      Type Parameters:
      T - type of the set's data.
      Returns:
      a new HashSet object.
    • getNewList

      protected static <T> List<T> getNewList()
      THis method returns the new ArrayList.
      Type Parameters:
      T - type of the list's data.
      Returns:
      a new ArrayList object.
    • hasSingleKey

      protected static <K, V> boolean hasSingleKey(Map<K,V> map, K key)
      This method validates the given map has given element or not.
      Type Parameters:
      K - type of the key.
      V - type of the value.
      Parameters:
      map - a Map object.
      key - a key for validation
      Returns:
      a Boolean object.
    • convertToList

      protected static <T> List<T> convertToList(Collection<T> collection)
      This method returns the list from any type of collection.
      Type Parameters:
      T - type of the collection's data.
      Parameters:
      collection - a Collection object.
      Returns:
      a List of given collection data objects.