Interface TomlTable
- All Known Subinterfaces:
TomlParseResult
- All Known Implementing Classes:
EmptyTomlTable, MutableTomlTable
@DefaultQualifier(value=org.checkerframework.checker.nullness.qual.NonNull.class,
locations={RETURN,PARAMETER,FIELD})
public interface TomlTable
An interface for accessing data stored in Tom's Obvious, Minimal Language (TOML).
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanCheck if a key was set in the TOML document.default booleanCheck if a key was set in the TOML document.Get all the dotted entries of this table.dottedEntrySet(boolean includeTables) Get all the dotted entries of this table.Get all the dotted keys of this table.dottedKeySet(boolean includeTables) Get all the dotted keys of this table.Get all the entries in this table.entryPathSet(boolean includeTables) Get all the entries in this table.entrySet()Get the entries of this table.default @Nullable ObjectGet a value from the TOML document.@Nullable ObjectGet a value from the TOML document.default @Nullable TomlArrayGet an array from the TOML document.default @Nullable TomlArrayGet an array from the TOML document.default TomlArraygetArrayOrEmpty(String dottedKey) Get an array from the TOML document.default TomlArraygetArrayOrEmpty(List<String> path) Get an array from the TOML document.default @Nullable BooleangetBoolean(String dottedKey) Get a boolean from the TOML document.default booleangetBoolean(String dottedKey, BooleanSupplier defaultValue) Get a boolean from the TOML document, or return a default.default @Nullable BooleangetBoolean(List<String> path) Get a boolean from the TOML document.default booleangetBoolean(List<String> path, BooleanSupplier defaultValue) Get a boolean from the TOML document, or return a default.default @Nullable DoubleGet a double from the TOML document.default doublegetDouble(String dottedKey, DoubleSupplier defaultValue) Get a double from the TOML document, or return a default.default @Nullable DoubleGet a double from the TOML document.default doublegetDouble(List<String> path, DoubleSupplier defaultValue) Get a double from the TOML document, or return a default.default @Nullable LocalDategetLocalDate(String dottedKey) Get a local date from the TOML document.default LocalDategetLocalDate(String dottedKey, Supplier<LocalDate> defaultValue) Get a local date from the TOML document, or return a default.default @Nullable LocalDategetLocalDate(List<String> path) Get a local date from the TOML document.default LocalDategetLocalDate(List<String> path, Supplier<LocalDate> defaultValue) Get a local date from the TOML document, or return a default.default @Nullable LocalDateTimegetLocalDateTime(String dottedKey) Get a local date time from the TOML document.default LocalDateTimegetLocalDateTime(String dottedKey, Supplier<LocalDateTime> defaultValue) Get a local date time from the TOML document, or return a default.default @Nullable LocalDateTimegetLocalDateTime(List<String> path) Get a local date time from the TOML document.default LocalDateTimegetLocalDateTime(List<String> path, Supplier<LocalDateTime> defaultValue) Get a local date time from the TOML document, or return a default.default @Nullable LocalTimegetLocalTime(String dottedKey) Get a local time from the TOML document.default LocalTimegetLocalTime(String dottedKey, Supplier<LocalTime> defaultValue) Get a local time from the TOML document, or return a default.default @Nullable LocalTimegetLocalTime(List<String> path) Get a local time from the TOML document.default LocalTimegetLocalTime(List<String> path, Supplier<LocalTime> defaultValue) Get a local time from the TOML document, or return a default.default @Nullable LongGet a long from the TOML document.default longgetLong(String dottedKey, LongSupplier defaultValue) Get a long from the TOML document, or return a default.default @Nullable LongGet a long from the TOML document.default longgetLong(List<String> path, LongSupplier defaultValue) Get a long from the TOML document, or return a default.default @Nullable OffsetDateTimegetOffsetDateTime(String dottedKey) Get an offset date time from the TOML document.default OffsetDateTimegetOffsetDateTime(String dottedKey, Supplier<OffsetDateTime> defaultValue) Get an offset date time from the TOML document, or return a default.default @Nullable OffsetDateTimegetOffsetDateTime(List<String> path) Get an offset date time from the TOML document.default OffsetDateTimegetOffsetDateTime(List<String> path, Supplier<OffsetDateTime> defaultValue) Get an offset date time from the TOML document, or return a default.default @Nullable StringGet a string from the TOML document.default StringGet a string from the TOML document, or return a default.default @Nullable StringGet a string from the TOML document.default StringGet a string from the TOML document, or return a default.default @Nullable TomlTableGet a table from the TOML document.default @Nullable TomlTableGet a table from the TOML document.default TomlTablegetTableOrEmpty(String dottedKey) Get a table from the TOML document.default TomlTablegetTableOrEmpty(List<String> path) Get a table from the TOML document.default @Nullable TomlPositioninputPositionOf(String dottedKey) Get the position where a key is defined in the TOML document.@Nullable TomlPositioninputPositionOf(List<String> path) Get the position where a key is defined in the TOML document.default booleanCheck if a value in the TOML document is an array.default booleanCheck if a value in the TOML document is an array.default booleanCheck if a value in the TOML document is a boolean.default booleanCheck if a value in the TOML document is a boolean.default booleanCheck if a value in the TOML document is a double.default booleanCheck if a value in the TOML document is a double.booleanisEmpty()trueif there are no entries in this table.default booleanisLocalDate(String dottedKey) Check if a value in the TOML document is aLocalDate.default booleanisLocalDate(List<String> path) Check if a value in the TOML document is aLocalDate.default booleanisLocalDateTime(String dottedKey) Check if a value in the TOML document is aLocalDateTime.default booleanisLocalDateTime(List<String> path) Check if a value in the TOML document is aLocalDateTime.default booleanisLocalTime(String dottedKey) Check if a value in the TOML document is aLocalTime.default booleanisLocalTime(List<String> path) Check if a value in the TOML document is aLocalTime.default booleanCheck if a value in the TOML document is a long.default booleanCheck if a value in the TOML document is a long.default booleanisOffsetDateTime(String dottedKey) Check if a value in the TOML document is anOffsetDateTime.default booleanisOffsetDateTime(List<String> path) Check if a value in the TOML document is anOffsetDateTime.default booleanCheck if a value in the TOML document is a string.default booleanCheck if a value in the TOML document is a string.default booleanCheck if a value in the TOML document is a table.default booleanCheck if a value in the TOML document is a table.Get all the paths in this table.keyPathSet(boolean includeTables) Get all the paths in this table.keySet()Get the keys of this table.intsize()Return the number of entries in tis table.default voidtoJson(Appendable appendable, EnumSet<JsonOptions> options) Append a JSON representation of this table to the appendable output.default voidtoJson(Appendable appendable, JsonOptions... options) Append a JSON representation of this table to the appendable output.default StringtoJson(EnumSet<JsonOptions> options) Return a representation of this table using JSON.default StringtoJson(JsonOptions... options) Return a representation of this table using JSON.toMap()Get the elements of this array as aMap.default StringtoToml()Return a representation of this table using TOML.default voidtoToml(Appendable appendable) Append a TOML representation of this table to the appendable output.
-
Method Details
-
size
int size()Return the number of entries in tis table.- Returns:
- The number of entries in tis table.
-
isEmpty
boolean isEmpty()trueif there are no entries in this table.- Returns:
trueif there are no entries in this table.
-
contains
Check if a key was set in the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.port").- Returns:
trueif the key was set in the TOML document.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
contains
-
keySet
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()orkeyPathSet().- Returns:
- A set containing the keys of this table.
-
dottedKeySet
Get all the dotted keys of this table.Paths to intermediary and empty tables are not returned. To include these, use
dottedKeySet(boolean).- Returns:
- A set containing all the dotted keys of this table.
-
dottedKeySet
-
keyPathSet
Get all the paths in this table.Paths to intermediary and empty tables are not returned. To include these, use
keyPathSet(boolean).- Returns:
- A set containing all the key paths of this table.
-
keyPathSet
-
entrySet
Get the entries of this table.The returned set contains only immediate entries of this table, and not entries with dotted keys or key paths. For a complete view of all entries available in the TOML document, use
dottedEntrySet()orentryPathSet().- Returns:
- A set containing the immediate entries of this table.
-
dottedEntrySet
Get all the dotted entries of this table.Paths to intermediary and empty tables are not returned. To include these, use
dottedEntrySet(boolean).- Returns:
- A set containing all the entries of this table.
-
dottedEntrySet
-
entryPathSet
-
entryPathSet
-
get
Get a value from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If any element of the path preceding the final key is not a table.
-
get
Get a value from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If any element of the path preceding the final key is not a table.
-
inputPositionOf
Get the position where a key is defined in the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The input position, or
nullif the key was not set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If any element of the path preceding the final key is not a table.
-
inputPositionOf
Get the position where a key is defined in the TOML document.- Parameters:
path- The key path.- Returns:
- The input position, or
nullif the key was not set in the TOML document. - Throws:
TomlInvalidTypeException- If any element of the path preceding the final key is not a table.
-
isString
Check if a value in the TOML document is a string.- Parameters:
dottedKey- A dotted key (e.g."server.address.hostname").- Returns:
trueif the value can be obtained as a string.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isString
-
getString
Get a string from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.hostname").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a string, or any element of the path preceding the final key is not a table.
-
getString
Get a string from the TOML document.- Parameters:
path- A dotted key (e.g."server.address.hostname").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not a string, or any element of the path preceding the final key is not a table.
-
getString
Get a string from the TOML document, or return a default.- Parameters:
dottedKey- A dotted key (e.g."server.address.hostname").defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a string, or any element of the path preceding the final key is not a table.
-
getString
Get a string from the TOML document, or return a default.- Parameters:
path- The key path.defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
TomlInvalidTypeException- If the value is present but not a string, or any element of the path preceding the final key is not a table.
-
isLong
Check if a value in the TOML document is a long.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
trueif the value can be obtained as a long.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isLong
-
getLong
Get a long from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a long, or any element of the path preceding the final key is not a table.
-
getLong
Get a long from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not a long, or any element of the path preceding the final key is not a table.
-
getLong
Get a long from the TOML document, or return a default.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a long, or any element of the path preceding the final key is not a table.
-
getLong
Get a long from the TOML document, or return a default.- Parameters:
path- The key path.defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
TomlInvalidTypeException- If the value is present but not a long, or any element of the path preceding the final key is not a table.
-
isDouble
Check if a value in the TOML document is a double.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
trueif the value can be obtained as a double.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isDouble
-
getDouble
Get a double from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a double, or any element of the path preceding the final key is not a table.
-
getDouble
Get a double from the TOML document.- Parameters:
path- A dotted key.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not a double, or any element of the path preceding the final key is not a table.
-
getDouble
Get a double from the TOML document, or return a default.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a double, or any element of the path preceding the final key is not a table.
-
getDouble
Get a double from the TOML document, or return a default.- Parameters:
path- The key path.defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
TomlInvalidTypeException- If the value is present but not a double, or any element of the path preceding the final key is not a table.
-
isBoolean
Check if a value in the TOML document is a boolean.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
trueif the value can be obtained as a boolean.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isBoolean
-
getBoolean
Get a boolean from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a boolean, or any element of the path preceding the final key is not a table.
-
getBoolean
Get a boolean from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not a boolean, or any element of the path preceding the final key is not a table.
-
getBoolean
Get a boolean from the TOML document, or return a default.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a boolean, or any element of the path preceding the final key is not a table.
-
getBoolean
Get a boolean from the TOML document, or return a default.- Parameters:
path- The key path.defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
TomlInvalidTypeException- If the value is present but not a boolean, or any element of the path preceding the final key is not a table.
-
isOffsetDateTime
Check if a value in the TOML document is anOffsetDateTime.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
trueif the value can be obtained as anOffsetDateTime.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isOffsetDateTime
Check if a value in the TOML document is anOffsetDateTime.- Parameters:
path- The key path.- Returns:
trueif the value can be obtained as anOffsetDateTime.
-
getOffsetDateTime
Get an offset date time from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not anOffsetDateTime, or any element of the path preceding the final key is not a table.
-
getOffsetDateTime
Get an offset date time from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not anOffsetDateTime, or any element of the path preceding the final key is not a table.
-
getOffsetDateTime
Get an offset date time from the TOML document, or return a default.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not anOffsetDateTime, or any element of the path preceding the final key is not a table.
-
getOffsetDateTime
Get an offset date time from the TOML document, or return a default.- Parameters:
path- The key path.defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
TomlInvalidTypeException- If the value is present but not anOffsetDateTime, or any element of the path preceding the final key is not a table.
-
isLocalDateTime
Check if a value in the TOML document is aLocalDateTime.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
trueif the value can be obtained as aLocalDateTime.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isLocalDateTime
Check if a value in the TOML document is aLocalDateTime.- Parameters:
path- The key path.- Returns:
trueif the value can be obtained as aLocalDateTime.
-
getLocalDateTime
Get a local date time from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not aLocalDateTime, or any element of the path preceding the final key is not a table.
-
getLocalDateTime
Get a local date time from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not aLocalDateTime, or any element of the path preceding the final key is not a table.
-
getLocalDateTime
Get a local date time from the TOML document, or return a default.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not aLocalDateTime, or any element of the path preceding the final key is not a table.
-
getLocalDateTime
Get a local date time from the TOML document, or return a default.- Parameters:
path- The key path.defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
TomlInvalidTypeException- If the value is present but not aLocalDateTime, or any element of the path preceding the final key is not a table.
-
isLocalDate
Check if a value in the TOML document is aLocalDate.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
trueif the value can be obtained as aLocalDate.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isLocalDate
-
getLocalDate
Get a local date from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not aLocalDate, or any element of the path preceding the final key is not a table.
-
getLocalDate
Get a local date from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not aLocalDate, or any element of the path preceding the final key is not a table.
-
getLocalDate
Get a local date from the TOML document, or return a default.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not aLocalDate, or any element of the path preceding the final key is not a table.
-
getLocalDate
Get a local date from the TOML document, or return a default.- Parameters:
path- The key path.defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
TomlInvalidTypeException- If the value is present but not aLocalDate, or any element of the path preceding the final key is not a table.
-
isLocalTime
Check if a value in the TOML document is aLocalTime.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
trueif the value can be obtained as aLocalTime.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isLocalTime
-
getLocalTime
Get a local time from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not aLocalTime, or any element of the path preceding the final key is not a table.
-
getLocalTime
Get a local time from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not aLocalTime, or any element of the path preceding the final key is not a table.
-
getLocalTime
Get a local time from the TOML document, or return a default.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not aLocalTime, or any element of the path preceding the final key is not a table.
-
getLocalTime
Get a local time from the TOML document, or return a default.- Parameters:
path- The key path.defaultValue- A supplier for the default value.- Returns:
- The value, or the default.
- Throws:
TomlInvalidTypeException- If the value is present but not aLocalTime, or any element of the path preceding the final key is not a table.
-
isArray
Check if a value in the TOML document is an array.- Parameters:
dottedKey- A dotted key (e.g."server.addresses").- Returns:
trueif the value can be obtained as an array.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isArray
-
getArray
Get an array from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.addresses").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not an array, or any element of the path preceding the final key is not a table.
-
getArray
Get an array from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not an array, or any element of the path preceding the final key is not a table.
-
getArrayOrEmpty
Get an array from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.addresses").- Returns:
- The value, or an empty array if no array was set in the TOML document.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not an array, or any element of the path preceding the final key is not a table.
-
getArrayOrEmpty
Get an array from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or an empty array if no array was set in the TOML document.
- Throws:
TomlInvalidTypeException- If the value is present but not an array, or any element of the path preceding the final key is not a table.
-
isTable
Check if a value in the TOML document is a table.- Parameters:
dottedKey- A dotted key (e.g."server.address").- Returns:
trueif the value can be obtained as a table.- Throws:
IllegalArgumentException- If the key cannot be parsed.
-
isTable
-
getTable
Get a table from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address").- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a table, or any element of the path preceding the final key is not a table.
-
getTable
Get a table from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or
nullif no value was set in the TOML document. - Throws:
TomlInvalidTypeException- If the value is present but not a table, or any element of the path preceding the final key is not a table.
-
getTableOrEmpty
Get a table from the TOML document.- Parameters:
dottedKey- A dotted key (e.g."server.address.port").- Returns:
- The value, or an empty table if no value was set in the TOML document.
- Throws:
IllegalArgumentException- If the key cannot be parsed.TomlInvalidTypeException- If the value is present but not a table, or any element of the path preceding the final key is not a table.
-
getTableOrEmpty
Get a table from the TOML document.- Parameters:
path- The key path.- Returns:
- The value, or an empty table if no value was set in the TOML document.
- Throws:
TomlInvalidTypeException- If the value is present but not a table, or any element of the path preceding the final key is not a table.
-
toMap
-
toJson
Return a representation of this table using JSON.- Parameters:
options- Options for the JSON encoder.- Returns:
- A JSON representation of this table.
-
toJson
Return a representation of this table using JSON.- Parameters:
options- Options for the JSON encoder.- Returns:
- A JSON representation of this table.
-
toJson
Append a JSON representation of this table to the appendable output.- Parameters:
appendable- The appendable output.options- Options for the JSON encoder.- Throws:
IOException- If an IO error occurs.
-
toJson
Append a JSON representation of this table to the appendable output.- Parameters:
appendable- The appendable output.options- Options for the JSON encoder.- Throws:
IOException- If an IO error occurs.
-
toToml
Return a representation of this table using TOML.- Returns:
- A TOML representation of this table.
-
toToml
Append a TOML representation of this table to the appendable output.- Parameters:
appendable- The appendable output.- Throws:
IOException- If an IO error occurs.
-