TomlLiteral

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

Represents literal value, which can be booleans, numbers, chars, strings.

Properties

Link copied to clipboard
open override val content: String

The converted value. (see creator functions with the same name)

Functions

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

Returns content as boolean.

Link copied to clipboard

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

Link copied to clipboard

Returns content as byte.

Link copied to clipboard

Returns content as byte only if content 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 of content is exactly 1, otherwise null.

Link copied to clipboard

Returns content as double.

Link copied to clipboard

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

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

Returns content as enum with given enum class context.

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

Returns content as enum with given enum class context only if content suits in, otherwise null.

Link copied to clipboard

Returns content as float.

Link copied to clipboard

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

Link copied to clipboard

Returns content as int.

Link copied to clipboard

Returns content as int only if content can be int, otherwise null.

Link copied to clipboard

Returns content as long.

Link copied to clipboard

Returns content as long only if content can be long, otherwise null.

Link copied to clipboard

Returns content as short.

Link copied to clipboard

Returns content as short only if content can be short, otherwise null.

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

Gives a string representation of this TomlElement. Each subclass has its own implementation.

Link copied to clipboard

Convert this to TomlArray.

Link copied to clipboard

Convert this to TomlLiteral.

Link copied to clipboard

Convert this to TomlNull.

Link copied to clipboard

Convert this to TomlTable.