|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.util.Objects
public final class Objects
Understands utility methods related to objects.
Field Summary | |
---|---|
static int |
HASH_CODE_PRIME
Prime number used to calculate the hash code of objects. |
Method Summary | ||
---|---|---|
static boolean |
areEqual(Object o1,
Object o2)
Returns true if the given objects are equal or if both objects are null . |
|
static
|
castIfBelongsToType(Object o,
Class<T> type)
Casts the given object to the given type only if the object is of the given type. |
|
static int |
hashCodeFor(Object o)
Returns the hash code for the given object. |
|
static String[] |
namesOf(Class<?>... types)
Returns an array containing the names of the given types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int HASH_CODE_PRIME
Method Detail |
---|
public static boolean areEqual(Object o1, Object o2)
true
if the given objects are equal or if both objects are null
.
o1
- one of the objects to compare.o2
- one of the objects to compare.
true
if the given objects are equal or if both objects are null
.public static String[] namesOf(Class<?>... types)
types
- the given types.
public static int hashCodeFor(Object o)
null
, this method returns zero. Otherwise
calls the method hashCode
of the given object.
o
- the given object.
public static <T> T castIfBelongsToType(Object o, Class<T> type)
null
.
T
- the generic type to cast the given object to.o
- the object to cast.type
- the given type.
null
if the given object is not to the given type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |