Value

class Value<T : Any>(val value: T) : Optional<T> (source)

Represents a field that was assigned a non-null value in the serialized entity. Equality and hashcode is implemented through its value.

Parameters

value

the value this optional wraps.

Constructors

Link copied to clipboard
constructor(value: T)

Properties

Link copied to clipboard
open override val value: T

Functions

Link copied to clipboard
Link copied to clipboard
operator fun component1(): T

Destructures this optional to its value.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
inline fun <E> Optional<List<E>>.filterList(mapper: (E) -> Boolean): Optional<List<E>>
Link copied to clipboard
inline fun <E> Optional<List<E>>.first(predicate: (E) -> Boolean): E
Link copied to clipboard
inline fun <E> Optional<List<E>>.firstOrNull(predicate: (E) -> Boolean): E?
Link copied to clipboard
inline fun <E : Any, T : Any> Optional<E>.flatMap(mapper: (E) -> Optional<T>): Optional<T>

Applies the mapper to the optional if it is a Value, returns the same optional otherwise.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
@JvmName(name = "mapNullableOptional")
inline fun <E : Any, T : Any> Optional<E?>.map(mapper: (E) -> T): Optional<T?>
inline fun <E : Any, T : Any> Optional<E>.map(mapper: (E) -> T): Optional<T>
Link copied to clipboard
@JvmName(name = "mapCopyOfMap")
fun <K, V> Optional<MutableMap<K, V>>.mapCopy(): Optional<Map<K, V>>
Link copied to clipboard
@JvmName(name = "mapNullableList")
inline fun <E, T> Optional<List<E>?>.mapList(mapper: (E) -> T): Optional<List<T>?>
inline fun <E, T> Optional<List<E>>.mapList(mapper: (E) -> T): Optional<List<T>>
Link copied to clipboard
inline fun <E : Any, T> Optional<E?>.mapNotNull(mapper: (E) -> T): Optional<T?>
Link copied to clipboard
inline fun <E, T> Optional<E>.mapNullable(mapper: (E) -> T): Optional<T?>
Link copied to clipboard
@JvmName(name = "mapNullableSnowflake")
inline fun <E : Any> Optional<E?>.mapSnowflake(mapper: (E) -> Snowflake): OptionalSnowflake
inline fun <E : Any> Optional<E>.mapSnowflake(mapper: (E) -> Snowflake): OptionalSnowflake
Link copied to clipboard
inline fun <K, V, R> Optional<Map<K, V>>.mapValues(mapper: (Map.Entry<K, V>) -> R): Optional<Map<K, R>>
Link copied to clipboard
fun <E> Optional<List<E>>.orEmpty(): List<E>
fun <E> Optional<Set<E>>.orEmpty(): Set<E>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
inline fun <T, R : Any> Optional<T>.unwrap(mapper: (T) -> R): R?