Class CollectionUtils


  • public class CollectionUtils
    extends 
    Static helper class for use dealing with Collections.
    Since:
    0.9
    • Constructor Summary

      Constructors 
      Constructor Description
      CollectionUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <E> <E> asList​(E... elements)  
      static <E> <E> asSet​(E... elements)  
      static boolean  c)
      Returns true if the specified Collection is null or , false otherwise.
      static boolean  m)
      Returns true if the specified Map is null or , false otherwise.
      static boolean isEmpty​(PrincipalCollection principals)
      Deprecated.
      Use PrincipalCollection.isEmpty() directly.
      static int  c)
      Returns the size of the specified collection or 0 if the collection is null.
      static int  m)
      Returns the size of the specified map or 0 if the map is null.
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
    • Constructor Detail

      • CollectionUtils

        public CollectionUtils()
    • Method Detail

      • asSet

        public static <E> <E> asSet​(E... elements)
      • isEmpty

        public static boolean isEmpty​( c)
        Returns true if the specified Collection is null or , false otherwise.
        Parameters:
        c - the collection to check
        Returns:
        true if the specified Collection is null or , false otherwise.
        Since:
        1.0
      • isEmpty

        public static boolean isEmpty​( m)
        Returns true if the specified Map is null or , false otherwise.
        Parameters:
        m - the Map to check
        Returns:
        true if the specified Map is null or , false otherwise.
        Since:
        1.0
      • size

        public static int size​( c)
        Returns the size of the specified collection or 0 if the collection is null.
        Parameters:
        c - the collection to check
        Returns:
        the size of the specified collection or 0 if the collection is null.
        Since:
        1.2
      • size

        public static int size​( m)
        Returns the size of the specified map or 0 if the map is null.
        Parameters:
        m - the map to check
        Returns:
        the size of the specified map or 0 if the map is null.
        Since:
        1.2
      • isEmpty

        public static boolean isEmpty​(PrincipalCollection principals)
        Deprecated.
        Use PrincipalCollection.isEmpty() directly.
        Returns true if the specified PrincipalCollection is null or empty, false otherwise.
        Parameters:
        principals - the principals to check.
        Returns:
        true if the specified PrincipalCollection is null or empty, false otherwise.
        Since:
        1.0
      • asList

        public static <E> <E> asList​(E... elements)