Dart API Referencedart:coreHashable

Hashable abstract class

Temporary interface for backwards compatibility.

All objects now have a hashCode method. This interface will be removed after a grace period. Code that use the Hashable interface should remove it, or use Object instead if a type is necessary.

abstract class Hashable {
  // TODO(lrn): http://darbug.com/5522
  abstract int get hashCode;
}

Properties

final int hashCode #

Get a hash code for this object.

All objects have hash codes. Hash codes are guaranteed to be the same for objects that are equal when compared using the equality operator ==. Other than that there are no guarantees about the hash codes. They will not be consistent between runs and there are no distribution guarantees.

If a subclass overrides hashCode it should override the equality operator as well to maintain consistency.

docs inherited from Object
abstract int get hashCode;