|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.ObjectUtil
public class ObjectUtil
This is a class of static methods useful for Objects in general. Currently it has helper methods that help in building equals and hashCode methods for Objects.
Constructor Summary | |
---|---|
ObjectUtil()
|
Method Summary | |
---|---|
static boolean |
equalsObj(java.lang.Object obj1,
java.lang.Object obj2)
Returns true if the two objects are both null, or both the same instance, or if they are both non-null and their equals method returns true. |
static int |
hashCodeNext(int hashCode,
boolean value)
Returns int hash code based on the previous hash code combined with the given boolean value, using int 1 for true and 0 for false. |
static int |
hashCodeNext(int hashCode,
int value)
Returns int hash code based on the previous hash code combined with the given int value, following the algorithm outlined in Sun's Javadoc for java.util.List hashCode. |
static int |
hashCodeNext(int hashCode,
long value)
Returns int hash code based on the previous hash code combined with the given long value, splitting the long value into two int values and doing the little-endian int first, and the big-endian int second. |
static int |
hashCodeNext(int hashCode,
java.lang.Object obj)
Returns int hash code based on the previous hash code combined with the hashcode for the given Object, or 0 if the Object is null. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectUtil()
Method Detail |
---|
public static boolean equalsObj(java.lang.Object obj1, java.lang.Object obj2)
public static int hashCodeNext(int hashCode, int value)
public static int hashCodeNext(int hashCode, long value)
public static int hashCodeNext(int hashCode, boolean value)
public static int hashCodeNext(int hashCode, java.lang.Object obj)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |