ValueEnumFromValue
open class ValueEnumFromValue<Value, T : Enum<T>, ValueEnum<Value>>(default: T, enumEntries: <Error class: unknown class><T>) : EnumFromValue<Value, T> (source)
EnumFromValue implementation for enums that implement the ValueEnum interface.
fromValueOrNull is implemented to use the result of the following operation:
enumEntries.find { it.value == value }
Content copied to clipboard
Note that fromValueOrNull can still be overridden if the default implementation isn't desirable.
Since
0.2.0
Parameters
default
The default enum value to use if no such value was found from the List.find operation.
enumEntries
The list of entries present in the ValueEnum.
See also
Functions
Link copied to clipboard
Link copied to clipboard
Gets the E representation of value, or null
if no such representation exists.
Link copied to clipboard