|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.pmd.util.CollectionUtil
Generic collection and array-related utility functions.
Field Summary | |
static TypeMap |
collectionClassesByNames
|
static TypeMap |
collectionInterfacesByNames
|
Method Summary | |
static boolean |
areEqual(java.lang.Object value,
java.lang.Object otherValue)
A comprehensive isEqual method that handles nulls and arrays safely. |
static boolean |
arraysAreEqual(java.lang.Object value,
java.lang.Object otherValue)
Returns true if the objects are array instances and each of their elements compares via equals as well. |
static java.util.Set |
asSet(java.lang.Object[] items)
Returns the items as a populated set. |
static java.lang.Class |
getCollectionTypeFor(java.lang.String shortName)
Returns the collection type if we recognize it by its short name. |
static java.util.Map |
invertedMapFrom(java.util.Map source)
Returns a map based on the source but with the key & values swapped. |
static boolean |
isCollectionType(java.lang.Class clazzType,
boolean includeInterfaces)
Return whether we can identify the typeName as a java.util collection class or interface as specified. |
static boolean |
isCollectionType(java.lang.String typeName,
boolean includeInterfaces)
Return whether we can identify the typeName as a java.util collection class or interface as specified. |
static java.util.Map |
mapFrom(java.lang.Object[][] keyValueSets)
Creates and returns a map populated with the keyValuesSets where the value held by the tuples are they key and value in that order. |
static boolean |
valuesAreTransitivelyEqual(java.lang.Object[] thisArray,
java.lang.Object[] thatArray)
Returns whether the arrays are equal by examining each of their elements, even if they are arrays themselves. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final TypeMap collectionInterfacesByNames
public static final TypeMap collectionClassesByNames
Method Detail |
public static java.lang.Class getCollectionTypeFor(java.lang.String shortName)
shortName
- String
public static boolean isCollectionType(java.lang.String typeName, boolean includeInterfaces)
typeName
- StringincludeInterfaces
- boolean
public static boolean isCollectionType(java.lang.Class clazzType, boolean includeInterfaces)
clazzType
- ClassincludeInterfaces
- boolean
public static java.util.Set asSet(java.lang.Object[] items)
items
- Object[]
public static java.util.Map mapFrom(java.lang.Object[][] keyValueSets)
keyValueSets
- Object[][]
public static java.util.Map invertedMapFrom(java.util.Map source)
source
- Map
public static final boolean arraysAreEqual(java.lang.Object value, java.lang.Object otherValue)
value
- ObjectotherValue
- Object
public static final boolean valuesAreTransitivelyEqual(java.lang.Object[] thisArray, java.lang.Object[] thatArray)
thisArray
- Object[]thatArray
- Object[]
public static final boolean areEqual(java.lang.Object value, java.lang.Object otherValue)
value
- ObjectotherValue
- Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |