Package-level declarations
Implementations of utilities from the parent package, such as ValueEnumFromValue
:
enum class ExampleValue(override val value: String): ValueEnum<String> {
One("one"),
Two("two"),
Three("three");
companion object : ValueEnumFromValue<String, ExampleValue>(default = One, entries)
}
println(ExampleValue.fromValueOrNull("four")) // null
println(ExampleValue.fromValueOrNull("one")) // One
Content copied to clipboard
Types
Link copied to clipboard
open class ValueEnumFromValue<Value, T : Enum<T>, ValueEnum<Value>>(default: T, enumEntries: <Error class: unknown class><T>) : EnumFromValue<Value, T>
EnumFromValue implementation for enums that implement the ValueEnum interface.