Companion

Constants and factories.

Properties

Link copied to clipboard
const val ADULT_THRESHOLD: Int = 60

The threshold for being considered an elderly.

Link copied to clipboard
const val CHILD_THRESHOLD: Int = 18

The threshold for being considered a child.

Functions

Link copied to clipboard
fun fromAny(age: Any): Age

Returns the corresponding age in this enum given a string resembling it.

Link copied to clipboard
fun fromString(age: String): Age

Returns the corresponding age in this enum given a string resembling it.

Link copied to clipboard
fun fromYears(age: Int): Age

Returns the corresponding age in this enum given the age in years.