toml / org.apache.tuweni.toml / TomlTable

TomlTable

interface TomlTable (source)

An interface for accessing data stored in Tom's Obvious, Minimal Language (TOML).

Functions

contains

open fun contains(dottedKey: String): Boolean
open fun contains(path: MutableList<String>): Boolean

Check if a key was set in the TOML document.

dottedKeySet

open fun dottedKeySet(): MutableSet<String>

Get all the dotted keys of this table.

Paths to intermediary and empty tables are not returned. To include these, use #dottedKeySet(boolean).

open fun dottedKeySet(includeTables: Boolean): MutableSet<String>

Get all the dotted keys of this table.

get

open fun get(dottedKey: String): Any?
abstract fun get(path: MutableList<String>): Any?

Get a value from the TOML document.

getArray

open fun getArray(dottedKey: String): TomlArray?
open fun getArray(path: MutableList<String>): TomlArray?

Get an array from the TOML document.

getArrayOrEmpty

open fun getArrayOrEmpty(dottedKey: String): TomlArray
open fun getArrayOrEmpty(path: MutableList<String>): TomlArray

Get an array from the TOML document.

getBoolean

open fun getBoolean(dottedKey: String): Boolean?
open fun getBoolean(path: MutableList<String>): Boolean?

Get a boolean from the TOML document.

open fun getBoolean(dottedKey: String, defaultValue: BooleanSupplier): Boolean
open fun getBoolean(path: MutableList<String>, defaultValue: BooleanSupplier): Boolean

Get a boolean from the TOML document, or return a default.

getDouble

open fun getDouble(dottedKey: String): Double?
open fun getDouble(path: MutableList<String>): Double?

Get a double from the TOML document.

open fun getDouble(dottedKey: String, defaultValue: DoubleSupplier): Double
open fun getDouble(path: MutableList<String>, defaultValue: DoubleSupplier): Double

Get a double from the TOML document, or return a default.

getLocalDate

open fun getLocalDate(dottedKey: String): LocalDate?
open fun getLocalDate(path: MutableList<String>): LocalDate?

Get a local date from the TOML document.

open fun getLocalDate(dottedKey: String, defaultValue: Supplier<LocalDate>): LocalDate
open fun getLocalDate(path: MutableList<String>, defaultValue: Supplier<LocalDate>): LocalDate

Get a local date from the TOML document, or return a default.

getLocalDateTime

open fun getLocalDateTime(dottedKey: String): LocalDateTime?
open fun getLocalDateTime(path: MutableList<String>): LocalDateTime?

Get a local date time from the TOML document.

open fun getLocalDateTime(dottedKey: String, defaultValue: Supplier<LocalDateTime>): LocalDateTime
open fun getLocalDateTime(path: MutableList<String>, defaultValue: Supplier<LocalDateTime>): LocalDateTime

Get a local date time from the TOML document, or return a default.

getLocalTime

open fun getLocalTime(dottedKey: String): LocalTime?
open fun getLocalTime(path: MutableList<String>): LocalTime?

Get a local time from the TOML document.

open fun getLocalTime(dottedKey: String, defaultValue: Supplier<LocalTime>): LocalTime
open fun getLocalTime(path: MutableList<String>, defaultValue: Supplier<LocalTime>): LocalTime

Get a local time from the TOML document, or return a default.

getLong

open fun getLong(dottedKey: String): Long?
open fun getLong(path: MutableList<String>): Long?

Get a long from the TOML document.

open fun getLong(dottedKey: String, defaultValue: LongSupplier): Long
open fun getLong(path: MutableList<String>, defaultValue: LongSupplier): Long

Get a long from the TOML document, or return a default.

getOffsetDateTime

open fun getOffsetDateTime(dottedKey: String): OffsetDateTime?
open fun getOffsetDateTime(path: MutableList<String>): OffsetDateTime?

Get an offset date time from the TOML document.

open fun getOffsetDateTime(dottedKey: String, defaultValue: Supplier<OffsetDateTime>): OffsetDateTime
open fun getOffsetDateTime(path: MutableList<String>, defaultValue: Supplier<OffsetDateTime>): OffsetDateTime

Get an offset date time from the TOML document, or return a default.

getString

open fun getString(dottedKey: String): String?
open fun getString(path: MutableList<String>): String?

Get a string from the TOML document.

open fun getString(dottedKey: String, defaultValue: Supplier<String>): String
open fun getString(path: MutableList<String>, defaultValue: Supplier<String>): String

Get a string from the TOML document, or return a default.

getTable

open fun getTable(dottedKey: String): TomlTable?
open fun getTable(path: MutableList<String>): TomlTable?

Get a table from the TOML document.

getTableOrEmpty

open fun getTableOrEmpty(dottedKey: String): TomlTable
open fun getTableOrEmpty(path: MutableList<String>): TomlTable

Get a table from the TOML document.

inputPositionOf

open fun inputPositionOf(dottedKey: String): TomlPosition?
abstract fun inputPositionOf(path: MutableList<String>): TomlPosition?

Get the position where a key is defined in the TOML document.

isArray

open fun isArray(dottedKey: String): Boolean
open fun isArray(path: MutableList<String>): Boolean

Check if a value in the TOML document is an array.

isBoolean

open fun isBoolean(dottedKey: String): Boolean
open fun isBoolean(path: MutableList<String>): Boolean

Check if a value in the TOML document is a boolean.

isDouble

open fun isDouble(dottedKey: String): Boolean
open fun isDouble(path: MutableList<String>): Boolean

Check if a value in the TOML document is a double.

isEmpty

abstract fun isEmpty(): Boolean

isLocalDate

open fun isLocalDate(dottedKey: String): Boolean
open fun isLocalDate(path: MutableList<String>): Boolean

Check if a value in the TOML document is a LocalDate.

isLocalDateTime

open fun isLocalDateTime(dottedKey: String): Boolean
open fun isLocalDateTime(path: MutableList<String>): Boolean

Check if a value in the TOML document is a LocalDateTime.

isLocalTime

open fun isLocalTime(dottedKey: String): Boolean
open fun isLocalTime(path: MutableList<String>): Boolean

Check if a value in the TOML document is a LocalTime.

isLong

open fun isLong(dottedKey: String): Boolean
open fun isLong(path: MutableList<String>): Boolean

Check if a value in the TOML document is a long.

isOffsetDateTime

open fun isOffsetDateTime(dottedKey: String): Boolean
open fun isOffsetDateTime(path: MutableList<String>): Boolean

Check if a value in the TOML document is an OffsetDateTime.

isString

open fun isString(dottedKey: String): Boolean
open fun isString(path: MutableList<String>): Boolean

Check if a value in the TOML document is a string.

isTable

open fun isTable(dottedKey: String): Boolean
open fun isTable(path: MutableList<String>): Boolean

Check if a value in the TOML document is a table.

keyPathSet

open fun keyPathSet(): MutableSet<MutableList<String>>

Get all the paths in this table.

Paths to intermediary and empty tables are not returned. To include these, use #keyPathSet(boolean).

abstract fun keyPathSet(includeTables: Boolean): MutableSet<MutableList<String>>

Get all the paths in this table.

keySet

abstract fun keySet(): MutableSet<String>

Get the keys of this table.

The returned set contains only immediate keys to this table, and not dotted keys or key paths. For a complete view of keys available in the TOML document, use #dottedKeySet() or #keyPathSet().

size

abstract fun size(): Int

toJson

open fun toJson(): String

Return a representation of this table using JSON.

open fun toJson(appendable: Appendable): Unit

Append a JSON representation of this table to the appendable output.

toMap

abstract fun toMap(): MutableMap<String, Any>

Get the elements of this array as a Map.

Note that this does not do a deep conversion. If this array contains tables or arrays, they will be of type TomlTable or TomlArray respectively.

Inheritors

TomlParseResult

interface TomlParseResult : TomlTable

The result from parsing a TOML document.