MultiEquality<E> class

Combines several equalities into a single equality.

Tries each equality in order, using Equality.isValidKey, and returns the result of the first equality that applies to the argument or arguments.

For equals, the first equality that matches the first argument is used, and if the second argument of equals is not valid for that equality, it returns false.

Because the equalities are tried in order, they should generally work on disjoint types. Otherwise the multi-equality may give inconsistent results for equals(e1, e2) and equals(e2, e1). This can happen if one equality considers only e1 a valid key, and not e2, but an equality which is checked later, allows both.

Implemented types

Constructors

MultiEquality(Iterable<Equality<E>> equalities)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

equals(E e1, E e2) bool
Compare two elements for being equal.
override
hash(E e) int
Creates a combined hash code for a number of objects.
override
isValidKey(Object? o) bool
Test whether an object is a valid argument to equals and hash.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited