TomlLiteral

@Serializable(with = TomlLiteralSerializer::class)
class TomlLiteral : TomlElement(source)

Represents a literal value, which could be boolean, integer, float, string, date-time.

Types

Link copied to clipboard

The actual data type a TomlLiteral derives from.

Properties

Link copied to clipboard
open override val content: String

The stringified value.

Link copied to clipboard

The actual data type this literal derives from.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard

Returns content as Boolean only if it is "true" or "false", otherwise null.

Link copied to clipboard

Returns content as Byte.

Link copied to clipboard

Returns content as Byte only if it can be Byte, otherwise null.

Link copied to clipboard

Returns content as Char.

Link copied to clipboard

Returns content as Char only if the length is exactly 1, otherwise null.

Link copied to clipboard
Link copied to clipboard

Returns content as Double only if it can be an exact Double or inf/+inf/-inf/nan, otherwise null.

Link copied to clipboard
inline fun <E : Enum<E>> TomlLiteral.toEnum(serializersModule: SerializersModule = EmptySerializersModule()): E

Returns content as an enum value of the corresponding type.

Link copied to clipboard
inline fun <E : Enum<E>> TomlLiteral.toEnumOrNull(serializersModule: SerializersModule = EmptySerializersModule()): E?

Returns content as an enum value of the corresponding type only if it suits in, otherwise null.

Link copied to clipboard
Link copied to clipboard

Returns content as Float only if it can be an exact Float or inf/+inf/-inf/nan, otherwise null.

Link copied to clipboard

Returns content as Int.

Link copied to clipboard

Returns content as Int only if it can be Int, otherwise null.

Link copied to clipboard
Link copied to clipboard

Returns content as TomlLocalDate only if it can be parsed, otherwise null.

Link copied to clipboard

Returns content as TomlLocalDateTime only if it can be parsed, otherwise null.

Link copied to clipboard
Link copied to clipboard

Returns content as TomlLocalTime only if it can be parsed, otherwise null.

Link copied to clipboard

Returns content as Long.

Link copied to clipboard

Returns content as Long only if it can be Long, otherwise null.

Link copied to clipboard

Returns content as TomlOffsetDateTime only if it can be parsed, otherwise null.

Link copied to clipboard
Link copied to clipboard

Returns content as Short only if it can be Short, otherwise null.

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

The string representation of this element.

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

Returns content as UByte only if it can be UByte, otherwise null.

Link copied to clipboard

Returns content as UInt.

Link copied to clipboard

Returns content as UInt only if it can be UInt, otherwise null.

Link copied to clipboard
Link copied to clipboard

Returns content as ULong only if it can be ULong, otherwise null.

Link copied to clipboard
Link copied to clipboard

Returns content as UShort only if it can be UShort, otherwise null.