Class CollectionUtils


  • public final class CollectionUtils
    extends java.lang.Object
    a collection of static methods for determining if a class belongs to one or more collection types.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.apache.bcel.classfile.JavaClass LIST_CLASS  
      private static org.apache.bcel.classfile.JavaClass MAP_CLASS  
      private static org.apache.bcel.classfile.JavaClass SET_CLASS  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CollectionUtils()
      private to reinforce the helper status of the class
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isEmpty​(java.util.Collection<?> c)  
      static boolean isEmpty​(java.util.Map<?,​?> m)  
      static <T> boolean isEmpty​(T... a)  
      static boolean isListSetMap​(java.lang.String clsName)
      determines if the current class name is derived from List, Set or Map
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LIST_CLASS

        private static org.apache.bcel.classfile.JavaClass LIST_CLASS
      • SET_CLASS

        private static org.apache.bcel.classfile.JavaClass SET_CLASS
      • MAP_CLASS

        private static org.apache.bcel.classfile.JavaClass MAP_CLASS
    • Constructor Detail

      • CollectionUtils

        private CollectionUtils()
        private to reinforce the helper status of the class
    • Method Detail

      • isListSetMap

        public static boolean isListSetMap​(java.lang.String clsName)
                                    throws java.lang.ClassNotFoundException
        determines if the current class name is derived from List, Set or Map
        Parameters:
        clsName - the class to determine it's parentage
        Returns:
        if the class is a List, Set or Map
        Throws:
        java.lang.ClassNotFoundException - if the cls parameter can't be found
      • isEmpty

        public static boolean isEmpty​(java.util.Collection<?> c)
      • isEmpty

        public static boolean isEmpty​(java.util.Map<?,​?> m)
      • isEmpty

        @SafeVarargs
        public static <T> boolean isEmpty​(T... a)