Indicates whether the objects passed as a
and b
are equal.
Indicates whether the objects passed as a
and b
are equal.
a left-hand value being compared with another (right-hand-side one) for equality (e.g., a == b
)
a right-hand value being compared with another (left-hand-side one) for equality (e.g., a == b
)
true if the passed objects are "equal," as defined by this Equality
instance
Returns a hash code for the specified object that is consistent with areEqual
.
Returns a hash code for the specified object that is consistent with areEqual
.
See the main documentation of this trait for more detail on the contract of hashCodeFor
.
A final implementation of the areEquivalent
method of Equivalence
that just passes
a
and b
to areEqual
and returns the result.
A final implementation of the areEquivalent
method of Equivalence
that just passes
a
and b
to areEqual
and returns the result.
This method enables any Equality
to be used where an Equivalence
is needed, such
as the implicit enabling methods of TypeCheckedTripleEquals
and ConversionCheckedTripleEquals
.
a left-hand value being compared with another, right-hand, value for equality (e.g., a == b
)
a right-hand value being compared with another, left-hand, value for equality (e.g., a == b
)
true if the passed objects are "equal," as defined by the areEqual
method of this
Equality
instance
An
Equality[T]
that offers ahashCodeFor
method that can provide anInt
hash code for a givenT
instance, whose contract is constrainted by that ofareEqual
.The general contract of
hashCodeFor
is:- Whenever
hashCodeFor
is passed on the same object more than once during an execution an application,hashCodeFor
must consistently return the same integer, provided no information used inareEqual
comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.- If two objects are equal according to the
areEqual
method, then passing either of those objects to thehashCodeFor
method must produce the same integer result.- It is not required that if two objects are unequal according to the
areEqual
method, then calling thehashCodeFor
method on each of the two objects must produce distinct integer results. However, you should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.Trait
HashingEquality
is used by instances ofEquaPath#EquaSet
to implement hash sets based on custom equalities.