ItemListValue

open class ItemListValue<T : MutableSet<E>, E>(name: String, value: T, var items: Set<ItemListValue.NamedItem<E>>, innerValueType: ValueType = ValueType.INVALID, innerType: Class<E>) : ListValue<T, E>

Constructors

Link copied to clipboard
constructor(name: String, value: T, items: Set<ItemListValue.NamedItem<E>>, innerValueType: ValueType = ValueType.INVALID, innerType: Class<E>)

Types

Link copied to clipboard
data class NamedItem<T>(val name: String, val value: T, val icon: String? = null)

Properties

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

If true, value will not be included in generated public config

Link copied to clipboard
Link copied to clipboard

Used to deserialize the value from JSON. TODO: Might replace innerType with a Class variable from the inner value type in the future.

Link copied to clipboard

Used to determine the type of the inner value.

Link copied to clipboard

If true, value will always keep inner equals defaultValue

Link copied to clipboard
Link copied to clipboard
var key: String?
Link copied to clipboard
@SerializedName(value = "name")
val name: String
Link copied to clipboard

If true, value will not be included in generated RestAPI config

Link copied to clipboard

Functions

Link copied to clipboard
fun asStateFlow(): StateFlow<T>
Link copied to clipboard

Binds to the given input name.

fun Value<InputBind>.bind(key: InputConstants.Key, action: InputBind.BindAction, modifiers: Set<InputBind.Modifier>)

Binds to the given input type and code.

Link copied to clipboard
override fun deserializeFrom(gson: Gson, element: JsonElement)

Deserialize value from JSON

Link copied to clipboard
Link copied to clipboard
fun doNotIncludeWhen(condition: () -> Boolean): Value<T>
Link copied to clipboard
fun get(): T
Link copied to clipboard
@JvmName(name = "getTagValue")
fun getTagValue(): Any
Link copied to clipboard
@JvmName(name = "getValue")
fun getValue(): Any

operator fun getValue(u: Any?, property: KProperty<*>): T

Support for delegated properties example: var autoaim by boolean(name = "autoaim", default = true) if(!autoaim) autoaim = true

Link copied to clipboard
fun immutable(): Value<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun onChange(listener: ValueListener<T>): Value<T>
Link copied to clipboard
Link copied to clipboard
open fun restore()

Restore value to default value

Link copied to clipboard
fun set(t: T)
fun set(t: T, apply: Consumer<in T>)
Link copied to clipboard
override fun setByString(string: String)
Link copied to clipboard
@JvmName(name = "setValue")
fun setValue(t: Value): Result<Unit>
operator fun setValue(u: Any?, property: KProperty<*>, t: T)
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard

Unbinds the key by setting it to UNKNOWN_KEY.