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. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

equals(E e1, E e2) bool
Compare two elements for being equal. [...]
override
hash(E e) int
Get a hashcode of an element. [...]
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 non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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