| java.lang.Object net.sourceforge.pmd.util.CollectionUtil
CollectionUtil | public class CollectionUtil (Code) | | Generic collection and array-related utility functions.
author: Brian Remedios version: $Revision$ |
Method Summary | |
final public static boolean | areEqual(Object value, Object otherValue) A comprehensive isEqual method that handles nulls and arrays safely. | final public static boolean | arraysAreEqual(Object value, Object otherValue) Returns true if the objects are array instances and each of their elements compares
via equals as well. | public static Set<T> | asSet(T[] items) Returns the items as a populated set. | public static Class | getCollectionTypeFor(String shortName) Returns the collection type if we recognize it by its short name. | public static Map<V, K> | invertedMapFrom(Map<K, V> source) Returns a map based on the source but with the key & values swapped. | public static boolean | isCollectionType(String typeName, boolean includeInterfaces) Return whether we can identify the typeName as a java.util collection class
or interface as specified. | public static boolean | isCollectionType(Class clazzType, boolean includeInterfaces) Return whether we can identify the typeName as a java.util collection class
or interface as specified. | public static Map<K, V> | mapFrom(K[] keys, V[] values) Creates and returns a map populated with the keyValuesSets where
the value held by the tuples are they key and value in that order. | final public static boolean | valuesAreTransitivelyEqual(Object[] thisArray, Object[] thatArray) Returns whether the arrays are equal by examining each of their elements, even if they are
arrays themselves. |
collectionClassesByNames | final public static TypeMap collectionClassesByNames(Code) | | |
collectionInterfacesByNames | final public static TypeMap collectionInterfacesByNames(Code) | | |
areEqual | final public static boolean areEqual(Object value, Object otherValue)(Code) | | A comprehensive isEqual method that handles nulls and arrays safely.
Parameters: value - Object Parameters: otherValue - Object boolean |
arraysAreEqual | final public static boolean arraysAreEqual(Object value, Object otherValue)(Code) | | Returns true if the objects are array instances and each of their elements compares
via equals as well.
Parameters: value - Object Parameters: otherValue - Object boolean |
asSet | public static Set<T> asSet(T[] items)(Code) | | Returns the items as a populated set.
Parameters: items - Object[] Set |
getCollectionTypeFor | public static Class getCollectionTypeFor(String shortName)(Code) | | Returns the collection type if we recognize it by its short name.
Parameters: shortName - String Class |
invertedMapFrom | public static Map<V, K> invertedMapFrom(Map<K, V> source)(Code) | | Returns a map based on the source but with the key & values swapped.
Parameters: source - Map Map |
isCollectionType | public static boolean isCollectionType(String typeName, boolean includeInterfaces)(Code) | | Return whether we can identify the typeName as a java.util collection class
or interface as specified.
Parameters: typeName - String Parameters: includeInterfaces - boolean boolean |
isCollectionType | public static boolean isCollectionType(Class clazzType, boolean includeInterfaces)(Code) | | Return whether we can identify the typeName as a java.util collection class
or interface as specified.
Parameters: clazzType - Class Parameters: includeInterfaces - boolean boolean |
mapFrom | public static Map<K, V> mapFrom(K[] keys, V[] values)(Code) | | Creates and returns a map populated with the keyValuesSets where
the value held by the tuples are they key and value in that order.
Parameters: keys - K[] Parameters: values - V[] Map |
valuesAreTransitivelyEqual | final public static boolean valuesAreTransitivelyEqual(Object[] thisArray, Object[] thatArray)(Code) | | Returns whether the arrays are equal by examining each of their elements, even if they are
arrays themselves.
Parameters: thisArray - Object[] Parameters: thatArray - Object[] boolean |
|
|