Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for testing the equality of value objects.

Type parameters

  • A

Hierarchy

  • IEquals

Implemented by

Index

Methods

Methods

equals

  • equals(other: A): boolean
  • Indicates whether some other object is "equal to" this one.

    Properties:

    • reflexive: for any value, x.equals(x) == true
    • symmetric: for any values x and y, x.equals(y) == y.equals(x)
    • transitive: x.equals(y) && y.equals(z) => x.equals(z)
    • consistent: x.equals(y) always yields the same result

    Rule: equal objects MUST have equal hash codes!

    Parameters

    • other: A

    Returns boolean

hashCode

  • hashCode(): number
  • Returns a hash code value for this value.

    This method is supported for the benefit of hash tables.

    Properties:

    • consistent: multiple invocations always yield the same result
    • if x.equals(y) == true then x.hashCode() == y.hashCode()
    • if x.equals(y) == false it is NOT required for their hash codes to be equal, i.e. this function is not injective

    Returns number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc