TriState

enum TriState : Enum<TriState> , TriStateProvider, EnumTranslatable, StringIdentifiable

Enum representing a three-state system: True, False, Default. This tri-state implements TriStateProvider, a generic representation of a three-state system.

In general, a DEFAULT should state should act as a "pass", refraining from altering state when possible.

Author

fzzyhmstrs

Since

0.6.5

Entries

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun asString(): String
Link copied to clipboard
open fun description(fallback: String? = null): MutableText

The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered.

Link copied to clipboard
open override fun descriptionKey(): String

Override of descriptionKey that utilized the prefix and enum constant name

Link copied to clipboard
open override fun getAsBoolean(): Boolean

Gets the value of the tri-state. Implemented from BooleanSupplier.

Link copied to clipboard
open override fun getBoxed(): Boolean?

Gets the value of the tri-state as a boxed, nullable boolean.

Link copied to clipboard

Whether this Translatable has a valid description

Link copied to clipboard
open override fun hasPrefix(): Boolean

Whether this Translatable has a valid prefix

Link copied to clipboard

Whether this Translatable has a valid translation

Link copied to clipboard
open override fun orElse(value: Boolean): Boolean

Gets the value of this tri-state. If the value is DEFAULT then use the supplied value.

Link copied to clipboard
open override fun orElseGet(supplier: BooleanSupplier): Boolean
open override fun orElseGet(supplier: Supplier<Boolean>): Boolean

Gets the value of this tri-state. If the value is DEFAULT then use the supplied value.

Link copied to clipboard
open fun prefix(fallback: String? = null): MutableText

The translated Text description from the descriptionKey. Falls back to an empty string so no tooltip is rendered.

open override fun prefix(): String

Defines the prefix of the translation/description key

Link copied to clipboard
open override fun prefixKey(): String

Override of descriptionKey that utilized the prefix and enum constant name

Link copied to clipboard
open override fun translation(fallback: String?): MutableText

Override of translation that falls back to the enum constant name. Example "TEST"

Link copied to clipboard
open override fun translationKey(): String

Override of translationKey that utilized the prefix and enum constant name

Link copied to clipboard
open override fun validate(input: Boolean): Boolean

Validates a provided boolean input against the current tri-state.

Link copied to clipboard
fun valueOf(value: String): TriState

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.