|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectEqualsUtil
Utilities
instead.
@Deprecated public final class EqualsUtil
Collected methods which allow easy implementation of equals
.
Example use case in a class called Car:
public boolean equals(Object aThat){ if ( this == aThat ) return true; if ( !(aThat instanceof Car) ) return false; Car that = (Car)aThat; return EqualsUtil.equals(this.fName, that.fName) && EqualsUtil.equals(this.fNumDoors, that.fNumDoors) && EqualsUtil.equals(this.fGasMileage, that.fGasMileage) && EqualsUtil.equals(this.fColor, that.fColor) && Arrays.equals(this.fMaintenanceChecks, that.fMaintenanceChecks); //array! }Arrays are not handled by this class. This is because the
Arrays.equals
methods should be used for
array fields.
Constructor Summary | |
---|---|
EqualsUtil()
Deprecated. |
Method Summary | |
---|---|
static boolean |
equals(boolean o1,
boolean o2)
Deprecated. |
static boolean |
equals(char o1,
char o2)
Deprecated. |
static boolean |
equals(double o1,
double o2)
Deprecated. |
static boolean |
equals(float o1,
float o2)
Deprecated. |
static boolean |
equals(long o1,
long o2)
Deprecated. |
static boolean |
equals(Object o1,
Object o2)
Deprecated. Possibly-null object field. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EqualsUtil()
Method Detail |
---|
public static boolean equals(boolean o1, boolean o2)
public static boolean equals(char o1, char o2)
public static boolean equals(long o1, long o2)
public static boolean equals(float o1, float o2)
public static boolean equals(double o1, double o2)
public static boolean equals(Object o1, Object o2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |