public final class ContainerEqualsUtils extends Object
EqualsUtils and
EqualsImplementationRegistry methods is, that the methods contained
in here are not strictly obeying to the equals contract, as the
implementation classes must not match - only the content is relevant.| Modifier and Type | Class and Description |
|---|---|
static class |
ContainerEqualsUtils.EContainerType
This enum differentiates the different meta container types.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equals(Object aObj1,
Object aObj2)
Check if the content of the passed containers is equal.
|
static boolean |
equalsAsList(Object aObj1,
Object aObj2)
This is a sanity method that first calls
getAsList(Object) on both
objects an than calls equals(Object, Object) on the collections. |
static List<?> |
getAsList(Object aObj)
Get the passed object as a
List object. |
static ContainerEqualsUtils.EContainerType |
getContainerTypeOfClass(Class<?> aClass) |
static ContainerEqualsUtils.EContainerType |
getContainerTypeOfObject(Object aObj) |
static boolean |
isContainerClass(Class<?> aClass) |
static boolean |
isContainerObject(Object aObj) |
@Nullable public static ContainerEqualsUtils.EContainerType getContainerTypeOfClass(@Nullable Class<?> aClass)
@Nullable public static ContainerEqualsUtils.EContainerType getContainerTypeOfObject(@Nullable Object aObj)
public static boolean equals(@Nullable Object aObj1, @Nullable Object aObj2)
EqualsImplementationRegistry.areEqual(Object, Object) method is
invoked to test for equality!aObj1 - The first containeraObj2 - The second containertrue if both objects are the same, or if they have the
same meta type and have the same content.IllegalArgumentException - if one of the arguments is not a container!@Nonnull public static List<?> getAsList(@Nonnull Object aObj)
List object. This is helpful in case you
want to compare the String array ["a", "b"] with the List<String> ("a",
"b") If the passed object is not a recognized. container type, than a new
list with one element is created!aObj - The object to be converted. May not be null.null.public static boolean equalsAsList(@Nullable Object aObj1, @Nullable Object aObj2)
getAsList(Object) on both
objects an than calls equals(Object, Object) on the collections.
This means that calling this method with the String array ["a", "b"] and
the List<String> ("a", "b") will result in a return value of true.aObj1 - The first object to be comparedaObj2 - The second object to be comparedtrue if the contents are equal, false
otherwiseCopyright © 2006–2014 phloc systems. All rights reserved.