Class IdentityEquivalence<T>
- java.lang.Object
-
- org.infinispan.commons.equivalence.IdentityEquivalence<T>
-
- All Implemented Interfaces:
Serializable
,Equivalence<T>
public class IdentityEquivalence<T> extends Object implements Equivalence<T>
Deprecated.Equivalence
implementation that uses theSystem.identityHashCode(Object)
as hash code function.- Since:
- 7.1
- Author:
- Pedro Ruivo
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IdentityEquivalence()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compare(T obj, T otherObj)
Deprecated.Compares the two given objects for order.boolean
equals(T obj, Object otherObj)
Deprecated.Indicates whether the objects passed are "equal to" each other.int
hashCode(Object obj)
Deprecated.Returns a hash code value for the object passed.boolean
isComparable(Object obj)
Deprecated.Returns whether the given object is comparable.String
toString(Object obj)
Deprecated.Returns a string representation of the given object.
-
-
-
Method Detail
-
hashCode
public int hashCode(Object obj)
Deprecated.Description copied from interface:Equivalence
Returns a hash code value for the object passed. As an example, implementors can provide an alternative implementation for the hash code calculation for arrays. So, instead of relying onObject.hashCode()
, callObject.hashCode()
.- Specified by:
hashCode
in interfaceEquivalence<T>
- Parameters:
obj
- instance to calculate hash code for- Returns:
- a hash code value for the object passed as parameter
-
equals
public boolean equals(T obj, Object otherObj)
Deprecated.Description copied from interface:Equivalence
Indicates whether the objects passed are "equal to" each other. As an example, implementors can provide an alternative implementation for the equals for arrays. So, instead of relying onObject.equals(Object)
}, callArrays.equals(Object[], Object[])
.- Specified by:
equals
in interfaceEquivalence<T>
- Parameters:
obj
- to be compared with second parameterotherObj
- to be compared with first parameter- Returns:
true
if both objects are the same;false
otherwise
-
toString
public String toString(Object obj)
Deprecated.Description copied from interface:Equivalence
Returns a string representation of the given object.- Specified by:
toString
in interfaceEquivalence<T>
- Parameters:
obj
- whose string representation is to be returned- Returns:
- a string representation of the passed object
-
isComparable
public boolean isComparable(Object obj)
Deprecated.Description copied from interface:Equivalence
Returns whether the given object is comparable. In other words, if given an instance of the object, a sensible comparison can be computed usingEquivalence.compare(Object, Object)
method.- Specified by:
isComparable
in interfaceEquivalence<T>
- Parameters:
obj
- instance to check if it's comparable- Returns:
true
if the object is comparable;false
otherwise
-
compare
public int compare(T obj, T otherObj)
Deprecated.Description copied from interface:Equivalence
Compares the two given objects for order. Returns a negative integer, zero, or a positive integer as the first object is less than, equal to, or greater than the second object.- Specified by:
compare
in interfaceEquivalence<T>
- Parameters:
obj
- first object to be comparedotherObj
- second object to be compared- Returns:
- a negative integer, zero, or a positive integer as the first object is less than, equal to, or greater than the second object
-
-