Class AnyEquivalence<T>
- java.lang.Object
-
- org.infinispan.commons.equivalence.AnyEquivalence<T>
-
- All Implemented Interfaces:
java.io.Serializable,Equivalence<T>
public final class AnyEquivalence<T> extends java.lang.Object implements Equivalence<T>
Deprecated.A compare function for objects.- Since:
- 5.3
- Author:
- Galder ZamarreƱo
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static AnyEquivalence<java.lang.Boolean>BOOLEANDeprecated.static AnyEquivalence<java.lang.Byte>BYTEDeprecated.static AnyEquivalence<java.lang.Double>DOUBLEDeprecated.static AnyEquivalence<java.lang.Float>FLOATDeprecated.static AnyEquivalence<java.lang.Integer>INTDeprecated.static AnyEquivalence<java.lang.Long>LONGDeprecated.static AnyEquivalence<java.lang.Short>SHORTDeprecated.static AnyEquivalence<java.lang.String>STRINGDeprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompare(T obj, T otherObj)Deprecated.Compares the two given objects for order.booleanequals(T obj, java.lang.Object otherObj)Deprecated.Indicates whether the objects passed are "equal to" each other.static <T> AnyEquivalence<T>getInstance()Deprecated.static <T> AnyEquivalence<T>getInstance(java.lang.Class<T> classType)Deprecated.inthashCode(java.lang.Object obj)Deprecated.Returns a hash code value for the object passed.booleanisComparable(java.lang.Object obj)Deprecated.Returns whether the given object is comparable.java.lang.StringtoString(java.lang.Object obj)Deprecated.Returns a string representation of the given object.
-
-
-
Field Detail
-
STRING
public static AnyEquivalence<java.lang.String> STRING
Deprecated.
-
BYTE
public static AnyEquivalence<java.lang.Byte> BYTE
Deprecated.
-
SHORT
public static AnyEquivalence<java.lang.Short> SHORT
Deprecated.
-
INT
public static AnyEquivalence<java.lang.Integer> INT
Deprecated.
-
LONG
public static AnyEquivalence<java.lang.Long> LONG
Deprecated.
-
DOUBLE
public static AnyEquivalence<java.lang.Double> DOUBLE
Deprecated.
-
FLOAT
public static AnyEquivalence<java.lang.Float> FLOAT
Deprecated.
-
BOOLEAN
public static AnyEquivalence<java.lang.Boolean> BOOLEAN
Deprecated.
-
-
Method Detail
-
hashCode
public int hashCode(java.lang.Object obj)
Deprecated.Description copied from interface:EquivalenceReturns 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:
hashCodein 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, java.lang.Object otherObj)
Deprecated.Description copied from interface:EquivalenceIndicates 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:
equalsin interfaceEquivalence<T>- Parameters:
obj- to be compared with second parameterotherObj- to be compared with first parameter- Returns:
trueif both objects are the same;falseotherwise
-
toString
public java.lang.String toString(java.lang.Object obj)
Deprecated.Description copied from interface:EquivalenceReturns a string representation of the given object.- Specified by:
toStringin interfaceEquivalence<T>- Parameters:
obj- whose string representation is to be returned- Returns:
- a string representation of the passed object
-
isComparable
public boolean isComparable(java.lang.Object obj)
Deprecated.Description copied from interface:EquivalenceReturns 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:
isComparablein interfaceEquivalence<T>- Parameters:
obj- instance to check if it's comparable- Returns:
trueif the object is comparable;falseotherwise
-
compare
public int compare(T obj, T otherObj)
Deprecated.Description copied from interface:EquivalenceCompares 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:
comparein 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
-
getInstance
public static <T> AnyEquivalence<T> getInstance()
Deprecated.
-
getInstance
public static <T> AnyEquivalence<T> getInstance(java.lang.Class<T> classType)
Deprecated.
-
-