public class IdentityEquivalence<T> extends Object implements Equivalence<T>
Equivalence
implementation that uses the System.identityHashCode(Object)
as hash code function.Constructor and Description |
---|
IdentityEquivalence()
Deprecated.
|
Modifier and Type | Method and 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.
|
public int hashCode(Object obj)
Equivalence
Object.hashCode()
, call Object.hashCode()
.hashCode
in interface Equivalence<T>
obj
- instance to calculate hash code forpublic boolean equals(T obj, Object otherObj)
Equivalence
Object.equals(Object)
}, call Arrays.equals(Object[], Object[])
.equals
in interface Equivalence<T>
obj
- to be compared with second parameterotherObj
- to be compared with first parametertrue
if both objects are the same;
false
otherwisepublic String toString(Object obj)
Equivalence
toString
in interface Equivalence<T>
obj
- whose string representation is to be returnedpublic boolean isComparable(Object obj)
Equivalence
Equivalence.compare(Object, Object)
method.isComparable
in interface Equivalence<T>
obj
- instance to check if it's comparabletrue
if the object is comparable;
false
otherwisepublic int compare(T obj, T otherObj)
Equivalence
compare
in interface Equivalence<T>
obj
- first object to be comparedotherObj
- second object to be comparedCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.