RequiredItem

open class RequiredItem<T@JvmOverloads() constructor(spec: Spec, name: String, description: String, type: JavaType?, nullable: Boolean) : Item<T>

Required item without default value.

Required item must be set with value before retrieved in config.

Constructors

RequiredItem
Link copied to clipboard
fun RequiredItem(spec: Spec, name: String, description: String = "", type: JavaType? = null, nullable: Boolean = false)

Functions

afterSet
Link copied to clipboard
fun afterSet(afterSetFunction: (config: Config, T) -> Unit): Handler
Subscribe the update event of this item after every set operation.
beforeSet
Link copied to clipboard
fun beforeSet(beforeSetFunction: (config: Config, T) -> Unit): Handler
Subscribe the update event of this item before every set operation.
notifyAfterSet
Link copied to clipboard
fun notifyAfterSet(config: Config, value: Any?)
notifyBeforeSet
Link copied to clipboard
fun notifyBeforeSet(config: Config, value: Any?)
notifySet
Link copied to clipboard
fun notifySet(value: Any?)
onSet
Link copied to clipboard
fun onSet(onSetFunction: (T) -> Unit): Handler
Subscribe the update event of this item.

Properties

asLazyItem
Link copied to clipboard
val asLazyItem: LazyItem<T>
Cast this item to a lazy item.
asOptionalItem
Link copied to clipboard
val asOptionalItem: OptionalItem<T>
Cast this item to an optional item.
asRequiredItem
Link copied to clipboard
val asRequiredItem: RequiredItem<T>
Cast this item to a required item.
description
Link copied to clipboard
val description: String
Description for this item.
isLazy
Link copied to clipboard
open val isLazy: Boolean
Whether this is a lazy item or not.
isOptional
Link copied to clipboard
open val isOptional: Boolean
Whether this is an optional item or not.
isRequired
Link copied to clipboard
open override val isRequired: Boolean = true
Whether this is a required item or not.
name
Link copied to clipboard
val name: String
Item name without prefix.
nullable
Link copied to clipboard
val nullable: Boolean
path
Link copied to clipboard
val path: Path
Item path without prefix.
spec
Link copied to clipboard
val spec: Spec
Config spec that contains this item.
type
Link copied to clipboard
val type: JavaType
Type of value that can be associated with this item.

Sources

jvm source
Link copied to clipboard