public interface TomlTable
Modifier and Type | Method and Description |
---|---|
default boolean |
contains(java.util.List<java.lang.String> path)
Check if a key was set in the TOML document.
|
default boolean |
contains(java.lang.String dottedKey)
Check if a key was set in the TOML document.
|
default java.util.Set<java.lang.String> |
dottedKeySet()
Get all the dotted keys of this table.
|
default java.util.Set<java.lang.String> |
dottedKeySet(boolean includeTables)
Get all the dotted keys of this table.
|
java.lang.Object |
get(java.util.List<java.lang.String> path)
Get a value from the TOML document.
|
default java.lang.Object |
get(java.lang.String dottedKey)
Get a value from the TOML document.
|
default TomlArray |
getArray(java.util.List<java.lang.String> path)
Get an array from the TOML document.
|
default TomlArray |
getArray(java.lang.String dottedKey)
Get an array from the TOML document.
|
default TomlArray |
getArrayOrEmpty(java.util.List<java.lang.String> path)
Get an array from the TOML document.
|
default TomlArray |
getArrayOrEmpty(java.lang.String dottedKey)
Get an array from the TOML document.
|
default java.lang.Boolean |
getBoolean(java.util.List<java.lang.String> path)
Get a boolean from the TOML document.
|
default boolean |
getBoolean(java.util.List<java.lang.String> path,
java.util.function.BooleanSupplier defaultValue)
Get a boolean from the TOML document, or return a default.
|
default java.lang.Boolean |
getBoolean(java.lang.String dottedKey)
Get a boolean from the TOML document.
|
default boolean |
getBoolean(java.lang.String dottedKey,
java.util.function.BooleanSupplier defaultValue)
Get a boolean from the TOML document, or return a default.
|
default java.lang.Double |
getDouble(java.util.List<java.lang.String> path)
Get a double from the TOML document.
|
default double |
getDouble(java.util.List<java.lang.String> path,
java.util.function.DoubleSupplier defaultValue)
Get a double from the TOML document, or return a default.
|
default java.lang.Double |
getDouble(java.lang.String dottedKey)
Get a double from the TOML document.
|
default double |
getDouble(java.lang.String dottedKey,
java.util.function.DoubleSupplier defaultValue)
Get a double from the TOML document, or return a default.
|
default java.time.LocalDate |
getLocalDate(java.util.List<java.lang.String> path)
Get a local date from the TOML document.
|
default java.time.LocalDate |
getLocalDate(java.util.List<java.lang.String> path,
java.util.function.Supplier<java.time.LocalDate> defaultValue)
Get a local date from the TOML document, or return a default.
|
default java.time.LocalDate |
getLocalDate(java.lang.String dottedKey)
Get a local date from the TOML document.
|
default java.time.LocalDate |
getLocalDate(java.lang.String dottedKey,
java.util.function.Supplier<java.time.LocalDate> defaultValue)
Get a local date from the TOML document, or return a default.
|
default java.time.LocalDateTime |
getLocalDateTime(java.util.List<java.lang.String> path)
Get a local date time from the TOML document.
|
default java.time.LocalDateTime |
getLocalDateTime(java.util.List<java.lang.String> path,
java.util.function.Supplier<java.time.LocalDateTime> defaultValue)
Get a local date time from the TOML document, or return a default.
|
default java.time.LocalDateTime |
getLocalDateTime(java.lang.String dottedKey)
Get a local date time from the TOML document.
|
default java.time.LocalDateTime |
getLocalDateTime(java.lang.String dottedKey,
java.util.function.Supplier<java.time.LocalDateTime> defaultValue)
Get a local date time from the TOML document, or return a default.
|
default java.time.LocalTime |
getLocalTime(java.util.List<java.lang.String> path)
Get a local time from the TOML document.
|
default java.time.LocalTime |
getLocalTime(java.util.List<java.lang.String> path,
java.util.function.Supplier<java.time.LocalTime> defaultValue)
Get a local time from the TOML document, or return a default.
|
default java.time.LocalTime |
getLocalTime(java.lang.String dottedKey)
Get a local time from the TOML document.
|
default java.time.LocalTime |
getLocalTime(java.lang.String dottedKey,
java.util.function.Supplier<java.time.LocalTime> defaultValue)
Get a local time from the TOML document, or return a default.
|
default java.lang.Long |
getLong(java.util.List<java.lang.String> path)
Get a long from the TOML document.
|
default long |
getLong(java.util.List<java.lang.String> path,
java.util.function.LongSupplier defaultValue)
Get a long from the TOML document, or return a default.
|
default java.lang.Long |
getLong(java.lang.String dottedKey)
Get a long from the TOML document.
|
default long |
getLong(java.lang.String dottedKey,
java.util.function.LongSupplier defaultValue)
Get a long from the TOML document, or return a default.
|
default java.time.OffsetDateTime |
getOffsetDateTime(java.util.List<java.lang.String> path)
Get an offset date time from the TOML document.
|
default java.time.OffsetDateTime |
getOffsetDateTime(java.util.List<java.lang.String> path,
java.util.function.Supplier<java.time.OffsetDateTime> defaultValue)
Get an offset date time from the TOML document, or return a default.
|
default java.time.OffsetDateTime |
getOffsetDateTime(java.lang.String dottedKey)
Get an offset date time from the TOML document.
|
default java.time.OffsetDateTime |
getOffsetDateTime(java.lang.String dottedKey,
java.util.function.Supplier<java.time.OffsetDateTime> defaultValue)
Get an offset date time from the TOML document, or return a default.
|
default java.lang.String |
getString(java.util.List<java.lang.String> path)
Get a string from the TOML document.
|
default java.lang.String |
getString(java.util.List<java.lang.String> path,
java.util.function.Supplier<java.lang.String> defaultValue)
Get a string from the TOML document, or return a default.
|
default java.lang.String |
getString(java.lang.String dottedKey)
Get a string from the TOML document.
|
default java.lang.String |
getString(java.lang.String dottedKey,
java.util.function.Supplier<java.lang.String> defaultValue)
Get a string from the TOML document, or return a default.
|
default TomlTable |
getTable(java.util.List<java.lang.String> path)
Get a table from the TOML document.
|
default TomlTable |
getTable(java.lang.String dottedKey)
Get a table from the TOML document.
|
default TomlTable |
getTableOrEmpty(java.util.List<java.lang.String> path)
Get a table from the TOML document.
|
default TomlTable |
getTableOrEmpty(java.lang.String dottedKey)
Get a table from the TOML document.
|
TomlPosition |
inputPositionOf(java.util.List<java.lang.String> path)
Get the position where a key is defined in the TOML document.
|
default TomlPosition |
inputPositionOf(java.lang.String dottedKey)
Get the position where a key is defined in the TOML document.
|
default boolean |
isArray(java.util.List<java.lang.String> path)
Check if a value in the TOML document is an array.
|
default boolean |
isArray(java.lang.String dottedKey)
Check if a value in the TOML document is an array.
|
default boolean |
isBoolean(java.util.List<java.lang.String> path)
Check if a value in the TOML document is a boolean.
|
default boolean |
isBoolean(java.lang.String dottedKey)
Check if a value in the TOML document is a boolean.
|
default boolean |
isDouble(java.util.List<java.lang.String> path)
Check if a value in the TOML document is a double.
|
default boolean |
isDouble(java.lang.String dottedKey)
Check if a value in the TOML document is a double.
|
boolean |
isEmpty() |
default boolean |
isLocalDate(java.util.List<java.lang.String> path)
Check if a value in the TOML document is a
LocalDate . |
default boolean |
isLocalDate(java.lang.String dottedKey)
Check if a value in the TOML document is a
LocalDate . |
default boolean |
isLocalDateTime(java.util.List<java.lang.String> path)
Check if a value in the TOML document is a
LocalDateTime . |
default boolean |
isLocalDateTime(java.lang.String dottedKey)
Check if a value in the TOML document is a
LocalDateTime . |
default boolean |
isLocalTime(java.util.List<java.lang.String> path)
Check if a value in the TOML document is a
LocalTime . |
default boolean |
isLocalTime(java.lang.String dottedKey)
Check if a value in the TOML document is a
LocalTime . |
default boolean |
isLong(java.util.List<java.lang.String> path)
Check if a value in the TOML document is a long.
|
default boolean |
isLong(java.lang.String dottedKey)
Check if a value in the TOML document is a long.
|
default boolean |
isOffsetDateTime(java.util.List<java.lang.String> path)
Check if a value in the TOML document is an
OffsetDateTime . |
default boolean |
isOffsetDateTime(java.lang.String dottedKey)
Check if a value in the TOML document is an
OffsetDateTime . |
default boolean |
isString(java.util.List<java.lang.String> path)
Check if a value in the TOML document is a string.
|
default boolean |
isString(java.lang.String dottedKey)
Check if a value in the TOML document is a string.
|
default boolean |
isTable(java.util.List<java.lang.String> path)
Check if a value in the TOML document is a table.
|
default boolean |
isTable(java.lang.String dottedKey)
Check if a value in the TOML document is a table.
|
default java.util.Set<java.util.List<java.lang.String>> |
keyPathSet()
Get all the paths in this table.
|
java.util.Set<java.util.List<java.lang.String>> |
keyPathSet(boolean includeTables)
Get all the paths in this table.
|
java.util.Set<java.lang.String> |
keySet()
Get the keys of this table.
|
int |
size() |
default java.lang.String |
toJson()
Return a representation of this table using JSON.
|
default void |
toJson(java.lang.Appendable appendable)
Append a JSON representation of this table to the appendable output.
|
java.util.Map<java.lang.String,java.lang.Object> |
toMap()
Get the elements of this array as a
Map . |
int size()
boolean isEmpty()
true
if there are no entries in this table.default boolean contains(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.port"
).true
if the key was set in the TOML document.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean contains(java.util.List<java.lang.String> path)
path
- The key path.true
if the key was set in the TOML document.java.util.Set<java.lang.String> keySet()
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()
.
default java.util.Set<java.lang.String> dottedKeySet()
Paths to intermediary and empty tables are not returned. To include these, use dottedKeySet(boolean)
.
default java.util.Set<java.lang.String> dottedKeySet(boolean includeTables)
includeTables
- If true
, also include paths to intermediary and empty tables.default java.util.Set<java.util.List<java.lang.String>> keyPathSet()
Paths to intermediary and empty tables are not returned. To include these, use keyPathSet(boolean)
.
java.util.Set<java.util.List<java.lang.String>> keyPathSet(boolean includeTables)
includeTables
- If true
, also include paths to intermediary and empty tables.@Nullable default java.lang.Object get(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if no value was set in the TOML document.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If any element of the path preceding the final key is not a table.@Nullable java.lang.Object get(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If any element of the path preceding the final key is not a table.@Nullable default TomlPosition inputPositionOf(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if the key was not set in the TOML document.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If any element of the path preceding the final key is not a table.@Nullable TomlPosition inputPositionOf(java.util.List<java.lang.String> path)
path
- The key path.null
if the key was not set in the TOML document.TomlInvalidTypeException
- If any element of the path preceding the final key is not a table.default boolean isString(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.hostname"
).true
if the value can be obtained as a string.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isString(java.util.List<java.lang.String> path)
path
- The key path.true
if the value can be obtained as a string.@Nullable default java.lang.String getString(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.hostname"
).null
if no value was set in the TOML document.java.lang.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.@Nullable default java.lang.String getString(java.util.List<java.lang.String> path)
path
- A dotted key (e.g. "server.address.hostname"
).null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not a string, or any element of the path preceding the
final key is not a table.default java.lang.String getString(java.lang.String dottedKey, java.util.function.Supplier<java.lang.String> defaultValue)
dottedKey
- A dotted key (e.g. "server.address.hostname"
).defaultValue
- A supplier for the default value.java.lang.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.default java.lang.String getString(java.util.List<java.lang.String> path, java.util.function.Supplier<java.lang.String> defaultValue)
path
- The key path.defaultValue
- A supplier for the default value.TomlInvalidTypeException
- If the value is present but not a string, or any element of the path preceding the
final key is not a table.default boolean isLong(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).true
if the value can be obtained as a long.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isLong(java.util.List<java.lang.String> path)
path
- The key path.true
if the value can be obtained as a long.@Nullable default java.lang.Long getLong(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if no value was set in the TOML document.java.lang.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.@Nullable default java.lang.Long getLong(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not a long, or any element of the path preceding the
final key is not a table.default long getLong(java.lang.String dottedKey, java.util.function.LongSupplier defaultValue)
dottedKey
- A dotted key (e.g. "server.address.port"
).defaultValue
- A supplier for the default value.java.lang.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.default long getLong(java.util.List<java.lang.String> path, java.util.function.LongSupplier defaultValue)
path
- The key path.defaultValue
- A supplier for the default value.TomlInvalidTypeException
- If the value is present but not a long, or any element of the path preceding the
final key is not a table.default boolean isDouble(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).true
if the value can be obtained as a double.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isDouble(java.util.List<java.lang.String> path)
path
- The key path.true
if the value can be obtained as a double.@Nullable default java.lang.Double getDouble(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if no value was set in the TOML document.java.lang.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.@Nullable default java.lang.Double getDouble(java.util.List<java.lang.String> path)
path
- A dotted key.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not a double, or any element of the path preceding the
final key is not a table.default double getDouble(java.lang.String dottedKey, java.util.function.DoubleSupplier defaultValue)
dottedKey
- A dotted key (e.g. "server.address.port"
).defaultValue
- A supplier for the default value.java.lang.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.default double getDouble(java.util.List<java.lang.String> path, java.util.function.DoubleSupplier defaultValue)
path
- The key path.defaultValue
- A supplier for the default value.TomlInvalidTypeException
- If the value is present but not a double, or any element of the path preceding the
final key is not a table.default boolean isBoolean(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).true
if the value can be obtained as a boolean.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isBoolean(java.util.List<java.lang.String> path)
path
- The key path.true
if the value can be obtained as a boolean.@Nullable default java.lang.Boolean getBoolean(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if no value was set in the TOML document.java.lang.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.@Nullable default java.lang.Boolean getBoolean(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not a boolean, or any element of the path preceding
the final key is not a table.default boolean getBoolean(java.lang.String dottedKey, java.util.function.BooleanSupplier defaultValue)
dottedKey
- A dotted key (e.g. "server.address.port"
).defaultValue
- A supplier for the default value.java.lang.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.default boolean getBoolean(java.util.List<java.lang.String> path, java.util.function.BooleanSupplier defaultValue)
path
- The key path.defaultValue
- A supplier for the default value.TomlInvalidTypeException
- If the value is present but not a boolean, or any element of the path preceding
the final key is not a table.default boolean isOffsetDateTime(java.lang.String dottedKey)
OffsetDateTime
.dottedKey
- A dotted key (e.g. "server.address.port"
).true
if the value can be obtained as an OffsetDateTime
.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isOffsetDateTime(java.util.List<java.lang.String> path)
OffsetDateTime
.path
- The key path.true
if the value can be obtained as an OffsetDateTime
.@Nullable default java.time.OffsetDateTime getOffsetDateTime(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if no value was set in the TOML document.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If the value is present but not an OffsetDateTime
, or any element of the
path preceding the final key is not a table.@Nullable default java.time.OffsetDateTime getOffsetDateTime(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not an OffsetDateTime
, or any element of the
path preceding the final key is not a table.default java.time.OffsetDateTime getOffsetDateTime(java.lang.String dottedKey, java.util.function.Supplier<java.time.OffsetDateTime> defaultValue)
dottedKey
- A dotted key (e.g. "server.address.port"
).defaultValue
- A supplier for the default value.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If the value is present but not an OffsetDateTime
, or any element of the
path preceding the final key is not a table.default java.time.OffsetDateTime getOffsetDateTime(java.util.List<java.lang.String> path, java.util.function.Supplier<java.time.OffsetDateTime> defaultValue)
path
- The key path.defaultValue
- A supplier for the default value.TomlInvalidTypeException
- If the value is present but not an OffsetDateTime
, or any element of the
path preceding the final key is not a table.default boolean isLocalDateTime(java.lang.String dottedKey)
LocalDateTime
.dottedKey
- A dotted key (e.g. "server.address.port"
).true
if the value can be obtained as a LocalDateTime
.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isLocalDateTime(java.util.List<java.lang.String> path)
LocalDateTime
.path
- The key path.true
if the value can be obtained as a LocalDateTime
.@Nullable default java.time.LocalDateTime getLocalDateTime(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if no value was set in the TOML document.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If the value is present but not a LocalDateTime
, or any element of the
path preceding the final key is not a table.@Nullable default java.time.LocalDateTime getLocalDateTime(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not a LocalDateTime
, or any element of the
path preceding the final key is not a table.default java.time.LocalDateTime getLocalDateTime(java.lang.String dottedKey, java.util.function.Supplier<java.time.LocalDateTime> defaultValue)
dottedKey
- A dotted key (e.g. "server.address.port"
).defaultValue
- A supplier for the default value.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If the value is present but not a LocalDateTime
, or any element of the
path preceding the final key is not a table.default java.time.LocalDateTime getLocalDateTime(java.util.List<java.lang.String> path, java.util.function.Supplier<java.time.LocalDateTime> defaultValue)
path
- The key path.defaultValue
- A supplier for the default value.TomlInvalidTypeException
- If the value is present but not a LocalDateTime
, or any element of the
path preceding the final key is not a table.default boolean isLocalDate(java.lang.String dottedKey)
LocalDate
.dottedKey
- A dotted key (e.g. "server.address.port"
).true
if the value can be obtained as a LocalDate
.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isLocalDate(java.util.List<java.lang.String> path)
LocalDate
.path
- The key path.true
if the value can be obtained as a LocalDate
.@Nullable default java.time.LocalDate getLocalDate(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if no value was set in the TOML document.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If the value is present but not a LocalDate
, or any element of the path
preceding the final key is not a table.@Nullable default java.time.LocalDate getLocalDate(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not a LocalDate
, or any element of the path
preceding the final key is not a table.default java.time.LocalDate getLocalDate(java.lang.String dottedKey, java.util.function.Supplier<java.time.LocalDate> defaultValue)
dottedKey
- A dotted key (e.g. "server.address.port"
).defaultValue
- A supplier for the default value.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If the value is present but not a LocalDate
, or any element of the path
preceding the final key is not a table.default java.time.LocalDate getLocalDate(java.util.List<java.lang.String> path, java.util.function.Supplier<java.time.LocalDate> defaultValue)
path
- The key path.defaultValue
- A supplier for the default value.TomlInvalidTypeException
- If the value is present but not a LocalDate
, or any element of the path
preceding the final key is not a table.default boolean isLocalTime(java.lang.String dottedKey)
LocalTime
.dottedKey
- A dotted key (e.g. "server.address.port"
).true
if the value can be obtained as a LocalTime
.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isLocalTime(java.util.List<java.lang.String> path)
LocalTime
.path
- The key path.true
if the value can be obtained as a LocalTime
.@Nullable default java.time.LocalTime getLocalTime(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).null
if no value was set in the TOML document.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If the value is present but not a LocalTime
, or any element of the path
preceding the final key is not a table.@Nullable default java.time.LocalTime getLocalTime(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not a LocalTime
, or any element of the path
preceding the final key is not a table.default java.time.LocalTime getLocalTime(java.lang.String dottedKey, java.util.function.Supplier<java.time.LocalTime> defaultValue)
dottedKey
- A dotted key (e.g. "server.address.port"
).defaultValue
- A supplier for the default value.java.lang.IllegalArgumentException
- If the key cannot be parsed.TomlInvalidTypeException
- If the value is present but not a LocalTime
, or any element of the path
preceding the final key is not a table.default java.time.LocalTime getLocalTime(java.util.List<java.lang.String> path, java.util.function.Supplier<java.time.LocalTime> defaultValue)
path
- The key path.defaultValue
- A supplier for the default value.TomlInvalidTypeException
- If the value is present but not a LocalTime
, or any element of the path
preceding the final key is not a table.default boolean isArray(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.addresses"
).true
if the value can be obtained as an array.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isArray(java.util.List<java.lang.String> path)
path
- The key path.true
if the value can be obtained as an array.@Nullable default TomlArray getArray(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.addresses"
).null
if no value was set in the TOML document.java.lang.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.@Nullable default TomlArray getArray(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not an array, or any element of the path preceding the
final key is not a table.default TomlArray getArrayOrEmpty(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.addresses"
).java.lang.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.default TomlArray getArrayOrEmpty(java.util.List<java.lang.String> path)
path
- The key path.TomlInvalidTypeException
- If the value is present but not an array, or any element of the path preceding the
final key is not a table.default boolean isTable(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address"
).true
if the value can be obtained as a table.java.lang.IllegalArgumentException
- If the key cannot be parsed.default boolean isTable(java.util.List<java.lang.String> path)
path
- The key path.true
if the value can be obtained as a table.@Nullable default TomlTable getTable(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address"
).null
if no value was set in the TOML document.java.lang.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.@Nullable default TomlTable getTable(java.util.List<java.lang.String> path)
path
- The key path.null
if no value was set in the TOML document.TomlInvalidTypeException
- If the value is present but not a table, or any element of the path preceding the
final key is not a table.default TomlTable getTableOrEmpty(java.lang.String dottedKey)
dottedKey
- A dotted key (e.g. "server.address.port"
).java.lang.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.default TomlTable getTableOrEmpty(java.util.List<java.lang.String> path)
path
- The key path.TomlInvalidTypeException
- If the value is present but not a table, or any element of the path preceding the
final key is not a table.java.util.Map<java.lang.String,java.lang.Object> toMap()
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.
Map
.default java.lang.String toJson()
default void toJson(java.lang.Appendable appendable) throws java.io.IOException
appendable
- The appendable output.java.io.IOException
- If an IO error occurs.