shadow:standard

Interface CanEqual<T>

interface CanEqual<T>

Interface CanEqual<T> specifies that a class can be tested for equality with an object of type T, producing a boolean which is true if the objects are identical. This interface allows overloading of the == operator. If this operator is applied, the appropriate equal(T) method will be called.

Method Summary

Modifiers Return Types Method and Description
public readonly (boolean) equal(T other)

Method called when the == operator is applied.

Method Detail

equal

public readonly equal(T other) => (boolean)

Method called when the == operator is applied. Should return true if the current object is identical to the other object. The relation defined by this method should be reflexive, symmetric, and transitive.

Parameters

other - object to compare to

Returns

true if identical