|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.base.Equivalences
@Beta public final class Equivalences
Contains static factory methods for creating Equivalence
instances.
All methods returns serializable instances.
Method Summary | |
---|---|
static Equivalence<Object> |
equals()
Returns an equivalence that delegates to Object.equals(java.lang.Object) and Object.hashCode() . |
static Equivalence<Object> |
identity()
Returns an equivalence that uses == to compare values and System.identityHashCode(Object) to compute the hash code. |
static Equivalence<Object> |
nullAwareEquals()
Returns an equivalence that delegates to Object.equals(java.lang.Object) and Object.hashCode() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Equivalence<Object> equals()
Object.equals(java.lang.Object)
and Object.hashCode()
.
Does not support null values.
public static Equivalence<Object> nullAwareEquals()
Object.equals(java.lang.Object)
and Object.hashCode()
.
Equivalence.equivalent(T, T)
returns true
if both values are null, or if neither
value is null and Object.equals(java.lang.Object)
returns true
. Equivalence.hash(T)
throws a
NullPointerException
if passed a null value.
public static Equivalence<Object> identity()
==
to compare values and System.identityHashCode(Object)
to compute the hash code. Equivalence.equivalent(T, T)
returns true
if both values are null, or if neither value is null and ==
returns true
. Equivalence.hash(T)
throws a NullPointerException
if passed
a null value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |