Package com.google.common.base
Class Equivalence.Identity
- java.lang.Object
-
- com.google.common.base.Equivalence<java.lang.Object>
-
- com.google.common.base.Equivalence.Identity
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.function.BiPredicate<java.lang.Object,java.lang.Object>
- Enclosing class:
- Equivalence<T>
static final class Equivalence.Identity extends Equivalence<java.lang.Object> implements java.io.Serializable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.base.Equivalence
Equivalence.Equals, Equivalence.Identity, Equivalence.Wrapper<T>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static Equivalence.Identity
INSTANCE
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description Identity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doEquivalent(java.lang.Object a, java.lang.Object b)
Implemented by the user to determine whethera
andb
are considered equivalent, subject to the requirements specified inEquivalence.equivalent(T, T)
.protected int
doHash(java.lang.Object o)
Implemented by the user to return a hash code fort
, subject to the requirements specified inEquivalence.hash(T)
.private java.lang.Object
readResolve()
-
Methods inherited from class com.google.common.base.Equivalence
equals, equivalent, equivalentTo, hash, identity, onResultOf, pairwise, test, wrap
-
-
-
-
Field Detail
-
INSTANCE
static final Equivalence.Identity INSTANCE
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
doEquivalent
protected boolean doEquivalent(java.lang.Object a, java.lang.Object b)
Description copied from class:Equivalence
Implemented by the user to determine whethera
andb
are considered equivalent, subject to the requirements specified inEquivalence.equivalent(T, T)
.This method should not be called except by
Equivalence.equivalent(T, T)
. WhenEquivalence.equivalent(T, T)
calls this method,a
andb
are guaranteed to be distinct, non-null instances.- Specified by:
doEquivalent
in classEquivalence<java.lang.Object>
-
doHash
protected int doHash(java.lang.Object o)
Description copied from class:Equivalence
Implemented by the user to return a hash code fort
, subject to the requirements specified inEquivalence.hash(T)
.This method should not be called except by
Equivalence.hash(T)
. WhenEquivalence.hash(T)
calls this method,t
is guaranteed to be non-null.- Specified by:
doHash
in classEquivalence<java.lang.Object>
-
readResolve
private java.lang.Object readResolve()
-
-