Class CollectionUtils


  • public final class CollectionUtils
    extends java.lang.Object
    • Field Detail

      • EMPTY_SORTED_SET

        public static final java.util.SortedSet EMPTY_SORTED_SET
    • Method Detail

      • isCollectionsWrapper

        public static boolean isCollectionsWrapper​(java.lang.Class cl)
      • isCollectionsWrapper

        public static boolean isCollectionsWrapper​(java.util.Collection c)
      • isCollectionsWrapper

        public static boolean isCollectionsWrapper​(java.util.Map m)
      • isSynchronizedWrapper

        public static boolean isSynchronizedWrapper​(java.lang.Class cl)
      • isSynchronizedWrapper

        public static boolean isSynchronizedWrapper​(java.util.Collection c)
      • isSynchronizedWrapper

        public static boolean isSynchronizedWrapper​(java.util.Map m)
      • isUnmodifiableWrapper

        public static boolean isUnmodifiableWrapper​(java.lang.Class cl)
      • isUnmodifiableWrapper

        public static boolean isUnmodifiableWrapper​(java.util.Collection c)
      • isUnmodifiableWrapper

        public static boolean isUnmodifiableWrapper​(java.util.Map m)
      • narrowUnmodifiableCollection

        public static java.util.Collection narrowUnmodifiableCollection​(java.util.Collection c)
      • narrowSynchronizedCollection

        public static java.util.Collection narrowSynchronizedCollection​(java.util.Collection c)
      • narrowUnmodifiableMap

        public static java.util.Map narrowUnmodifiableMap​(java.util.Map m)
      • narrowSynchronizedMap

        public static java.util.Map narrowSynchronizedMap​(java.util.Map m)
      • attemptClone

        public static java.util.Collection attemptClone​(java.util.Collection c)
                                                 throws java.lang.NoSuchMethodException
        Attempts to find a public clone() method or a copy constructor, in that order, and calls what it finds. If neither is available, throws a NoSuchMethodException.
        Throws:
        java.lang.NoSuchMethodException
      • attemptClone

        public static java.util.Map attemptClone​(java.util.Map m)
                                          throws java.lang.NoSuchMethodException
        Attempts to find a public clone() method or a copy constructor, in that order, and calls what it finds. If neither is available, throws a NoSuchMethodException.
        Throws:
        java.lang.NoSuchMethodException
      • add

        public static void add​(java.util.Collection c,
                               java.lang.Object o)
      • remove

        public static void remove​(java.util.Collection c,
                                  java.lang.Object o)
      • size

        public static int size​(java.lang.Object o)