StringValue

data class StringValue(val value: String) : TypedValue

Wrapper for a plain string value.

Constructors

Link copied to clipboard
constructor(value: String)

Properties

Link copied to clipboard
open override val stringValue: String

String representation of the value. For enums, this is the enum's name property. For strings, this is the string itself.

Link copied to clipboard

The string value

Functions

Link copied to clipboard

Returns the enum value if this is an EnumValue, null otherwise. The type is erased to Enum<*> since the actual type is not known at compile time.

Link copied to clipboard
inline fun <E : Enum<E>> getAs(): E?

Attempts to retrieve the value as the specified enum type.

fun <E : Enum<E>> getAs(kClass: KClass<E>): E?

Attempts to retrieve the value as the specified enum type using KClass.

Link copied to clipboard
inline fun <E : Enum<E>> isType(): Boolean

Checks if this value is of the specified enum type.

fun <E : Enum<E>> isType(kClass: KClass<E>): Boolean

Checks if this value is of the specified enum type using KClass.