DefaultEquality<E> class

Equality of objects that compares only the natural equality of the objects.

This equality uses the objects' own Object.== and Object.hashCode for the equality.

Note that equals and hash take Objects rather than Es. This allows E to be inferred as Null in const contexts where E wouldn't be a compile-time constant, while still allowing the class to be used at runtime.

Implemented types

Constructors

DefaultEquality()
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(Object e1, Object e2) bool
Compare two elements for being equal. [...]
override
hash(Object 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