ObjectIdentifier

class ObjectIdentifier<T : Any>(val ref: T)

A instance holder class serving as an object identifier for that instance reference.

This class is used to create a unique identifier for an object based on its memory address, relying on Java's [System.identityHashCode]. It provides a way to compare object references and equality check is implemented using reference equality (===).

This class is useful for creating unique identifiers for objects based on their memory address.

Parameters

T

The type of the object to identify.

Constructors

Link copied to clipboard
constructor(ref: T)

Properties

Link copied to clipboard
val ref: T

The object reference.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String