Optional Long
Represents a value that encapsulate the optional and value state of a Long in the Discord API. Specifically:
Missing - a Long field that was not present in the serialized entity.
Value - a Long field that was assigned a non-null value in the serialized entity.
Note that there is no nullable variant present. Use Long? or
OptionalLong?for this case instead.
The base class is (de)serializable with kotlinx.serialization.
Note that kotlinx.serialization does not call serializers for values that are not present in the serialized format. Optional fields should have a default value of OptionalLong.Missing:
@Serializable
class DiscordUser(
val id: Long,
val username: String,
val bot: OptionalLong = OptionalLong.Missing
)Content copied to clipboard
Inheritors
Types
Properties
Link copied to clipboard
Link copied to clipboard
returns null if this is null, calls OptionalLong.asNullable otherwise.
Link copied to clipboard
Link copied to clipboard
returns null if this is null, calls OptionalLong.asNullable otherwise.