|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jaggregate.Objects
public class Objects
Utility class that offers useful operations on objects in general.
Method Summary | |
---|---|
static boolean |
areEqual(Object first,
Object second)
Tells whether two object references are considered equivalent. |
static UnaryPredicate<Class<?>> |
classifies(Object instance)
Answers a predicate which will answer true if its argument is a class in
the hierarchy of the given object's class. |
static UnaryPredicate<Object> |
equalTo(Object comparand)
Answers a predicate which will answer true if its argument compares
equivalent to the given comparand. |
static String |
identityToString(Object target)
Answers the string representation for the target object, as Object 's implementation would compute it, disregarding overrides. |
static UnaryPredicate<Object> |
isA(Class<?> comparand)
Answers a predicate which will answer true if its argument is an
instance of the given comparand class. |
static int |
nullSafeHashCode(Object target)
Answers a hash value for the given target object. |
static UnaryPredicate<Object> |
sameAs(Object comparand)
Answers a predicate which will answer true if its argument refers to the
same object as the given comparand. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean areEqual(Object first, Object second)
null
.
first
- first referencesecond
- second reference
first == null ? second == null : first.equals(second)
public static int nullSafeHashCode(Object target)
target
- the target object
target
's hash value, or 0
if target
is null
public static String identityToString(Object target)
Object
's implementation would compute it, disregarding overrides.
target
- the target object
target
public static UnaryPredicate<Object> equalTo(Object comparand)
true
if its argument compares
equivalent to the given comparand.
comparand
- the comparand to use with the returned predicate
comparand
public static UnaryPredicate<Object> sameAs(Object comparand)
true
if its argument refers to the
same object as the given comparand.
comparand
- the comparand to use with the returned predicate
comparand
public static UnaryPredicate<Object> isA(Class<?> comparand)
true
if its argument is an
instance of the given comparand class.
comparand
- the comparand to use with the returned predicate
comparand
NullPointerException
- if comparand
is null
public static UnaryPredicate<Class<?>> classifies(Object instance)
true
if its argument is a class in
the hierarchy of the given object's class.
instance
- the comparand to use with the returned predicate
instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |