EnumValue.Unknown

class EnumValue.Unknown : EnumValue


Represents an unknown enum value.

This could happen, for example, if an enum gained a new value but this code was compiled for the older version that lacked the new enum value. Instead of failing, the unknown enum value will be gracefully mapped to Unknown.

Summary

Public constructors

Unknown(stringValue: String)

Public functions

EnumValue.Unknown
copy(stringValue: String)

Creates and returns a new Unknown instance with the given property values.

open operator Boolean
equals(other: Any?)

Compares this object with another object for equality.

open Int

Calculates and returns the hash code for this object.

open String

Returns a string representation of this object, useful for debugging.

Public properties

open String

The unknown string value.

open Nothing?

Always null.

Public constructors

Unknown

Unknown(stringValue: String)

Public functions

copy

fun copy(stringValue: String = this.stringValue): EnumValue.Unknown

Creates and returns a new Unknown instance with the given property values.

equals

open operator fun equals(other: Any?): Boolean

Compares this object with another object for equality.

Parameters
other: Any?

The object to compare to this for equality.

Returns
Boolean

true if, and only if, the other object is an instance of Unknown whose stringValue compares equal to this object's stringValue using the == operator.

hashCode

open fun hashCode(): Int

Calculates and returns the hash code for this object.

The hash code is not guaranteed to be stable across application restarts.

Returns
Int

the hash code for this object, that incorporates the values of this object's public properties.

toString

open fun toString(): String

Returns a string representation of this object, useful for debugging.

The string representation is not guaranteed to be stable and may change without notice at any time. Therefore, the only recommended usage of the returned string is debugging and/or logging. Namely, parsing the returned string or storing the returned string in non-volatile storage should generally be avoided in order to be robust in case that the string representation changes.

Public properties

stringValue

open val stringValueString

The unknown string value.

value

open val valueNothing?

Always null.