ItemsList

class ItemsList<T>(val items: List<T>)

An immutable list class that holds a list of items of type T.

This class provides an immutable wrapper around a standard list, ensuring that the contents cannot be modified after creation. It overrides equals and hashCode methods to provide proper equality checks and hash code generation based on the list contents.

Parameters

T

The type of elements in the list.

Constructors

Link copied to clipboard
constructor(items: List<T>)

Properties

Link copied to clipboard
val items: List<T>

The list of items contained in this ItemsList.

Functions

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

Compares this ItemsList object with another object for equality. The comparison checks whether the other object is also an ItemsList and contains the same items in the same order.

Link copied to clipboard
open override fun hashCode(): Int

Generates a hash code for this ItemsList. The hash code is generated based on the items in the list.