EnumishCompanion

interface EnumishCompanion<out T : Enumish>

Hierarchy-wide operations over kinds — the enum-like static side (entries / valueOf), implemented by the companion object of each generated Enumish.

Declared covariantly in T so companions of different hierarchies can be handled together, e.g. as List<EnumishCompanion<Enumish>>, without projections.

Properties

Link copied to clipboard
abstract val entries: List<T>

All kinds of the hierarchy.

Functions

Link copied to clipboard
abstract fun valueOf(value: String): T

Returns the kind whose Enumish.label equals value.

Link copied to clipboard
abstract fun valueOfOrNull(value: String): T?

Returns the kind whose Enumish.label equals value, or null (an addition over enums).