Interface TomlTable
- All Known Subinterfaces:
TomlParseResult
- All Known Implementing Classes:
EmptyTomlTable
,MutableTomlTable
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Check if a key was set in the TOML document.default boolean
Check 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 Object
Get a value from the TOML document.@Nullable Object
Get a value from the TOML document.default @Nullable TomlArray
Get an array from the TOML document.default @Nullable TomlArray
Get an array from the TOML document.default TomlArray
getArrayOrEmpty
(String dottedKey) Get an array from the TOML document.default TomlArray
getArrayOrEmpty
(List<String> path) Get an array from the TOML document.default @Nullable Boolean
getBoolean
(String dottedKey) Get a boolean from the TOML document.default boolean
getBoolean
(String dottedKey, BooleanSupplier defaultValue) Get a boolean from the TOML document, or return a default.default @Nullable Boolean
getBoolean
(List<String> path) Get a boolean from the TOML document.default boolean
getBoolean
(List<String> path, BooleanSupplier defaultValue) Get a boolean from the TOML document, or return a default.default @Nullable Double
Get a double from the TOML document.default double
getDouble
(String dottedKey, DoubleSupplier defaultValue) Get a double from the TOML document, or return a default.default @Nullable Double
Get a double from the TOML document.default double
getDouble
(List<String> path, DoubleSupplier defaultValue) Get a double from the TOML document, or return a default.default @Nullable LocalDate
getLocalDate
(String dottedKey) Get a local date from the TOML document.default LocalDate
getLocalDate
(String dottedKey, Supplier<LocalDate> defaultValue) Get a local date from the TOML document, or return a default.default @Nullable LocalDate
getLocalDate
(List<String> path) Get a local date from the TOML document.default LocalDate
getLocalDate
(List<String> path, Supplier<LocalDate> defaultValue) Get a local date from the TOML document, or return a default.default @Nullable LocalDateTime
getLocalDateTime
(String dottedKey) Get a local date time from the TOML document.default LocalDateTime
getLocalDateTime
(String dottedKey, Supplier<LocalDateTime> defaultValue) Get a local date time from the TOML document, or return a default.default @Nullable LocalDateTime
getLocalDateTime
(List<String> path) Get a local date time from the TOML document.default LocalDateTime
getLocalDateTime
(List<String> path, Supplier<LocalDateTime> defaultValue) Get a local date time from the TOML document, or return a default.default @Nullable LocalTime
getLocalTime
(String dottedKey) Get a local time from the TOML document.default LocalTime
getLocalTime
(String dottedKey, Supplier<LocalTime> defaultValue) Get a local time from the TOML document, or return a default.default @Nullable LocalTime
getLocalTime
(List<String> path) Get a local time from the TOML document.default LocalTime
getLocalTime
(List<String> path, Supplier<LocalTime> defaultValue) Get a local time from the TOML document, or return a default.default @Nullable Long
Get a long from the TOML document.default long
getLong
(String dottedKey, LongSupplier defaultValue) Get a long from the TOML document, or return a default.default @Nullable Long
Get a long from the TOML document.default long
getLong
(List<String> path, LongSupplier defaultValue) Get a long from the TOML document, or return a default.default @Nullable OffsetDateTime
getOffsetDateTime
(String dottedKey) Get an offset date time from the TOML document.default OffsetDateTime
getOffsetDateTime
(String dottedKey, Supplier<OffsetDateTime> defaultValue) Get an offset date time from the TOML document, or return a default.default @Nullable OffsetDateTime
getOffsetDateTime
(List<String> path) Get an offset date time from the TOML document.default OffsetDateTime
getOffsetDateTime
(List<String> path, Supplier<OffsetDateTime> defaultValue) Get an offset date time from the TOML document, or return a default.default @Nullable String
Get a string from the TOML document.default String
Get a string from the TOML document, or return a default.default @Nullable String
Get a string from the TOML document.default String
Get a string from the TOML document, or return a default.default @Nullable TomlTable
Get a table from the TOML document.default @Nullable TomlTable
Get a table from the TOML document.default TomlTable
getTableOrEmpty
(String dottedKey) Get a table from the TOML document.default TomlTable
getTableOrEmpty
(List<String> path) Get a table from the TOML document.default @Nullable TomlPosition
inputPositionOf
(String dottedKey) Get the position where a key is defined in the TOML document.@Nullable TomlPosition
inputPositionOf
(List<String> path) Get the position where a key is defined in the TOML document.default boolean
Check if a value in the TOML document is an array.default boolean
Check if a value in the TOML document is an array.default boolean
Check if a value in the TOML document is a boolean.default boolean
Check if a value in the TOML document is a boolean.default boolean
Check if a value in the TOML document is a double.default boolean
Check if a value in the TOML document is a double.boolean
isEmpty()
true
if there are no entries in this table.default boolean
isLocalDate
(String dottedKey) Check if a value in the TOML document is aLocalDate
.default boolean
isLocalDate
(List<String> path) Check if a value in the TOML document is aLocalDate
.default boolean
isLocalDateTime
(String dottedKey) Check if a value in the TOML document is aLocalDateTime
.default boolean
isLocalDateTime
(List<String> path) Check if a value in the TOML document is aLocalDateTime
.default boolean
isLocalTime
(String dottedKey) Check if a value in the TOML document is aLocalTime
.default boolean
isLocalTime
(List<String> path) Check if a value in the TOML document is aLocalTime
.default boolean
Check if a value in the TOML document is a long.default boolean
Check if a value in the TOML document is a long.default boolean
isOffsetDateTime
(String dottedKey) Check if a value in the TOML document is anOffsetDateTime
.default boolean
isOffsetDateTime
(List<String> path) Check if a value in the TOML document is anOffsetDateTime
.default boolean
Check if a value in the TOML document is a string.default boolean
Check if a value in the TOML document is a string.default boolean
Check if a value in the TOML document is a table.default boolean
Check 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.int
size()
Return the number of entries in tis table.default void
toJson
(Appendable appendable, EnumSet<JsonOptions> options) Append a JSON representation of this table to the appendable output.default void
toJson
(Appendable appendable, JsonOptions... options) Append a JSON representation of this table to the appendable output.default String
toJson
(EnumSet<JsonOptions> options) Return a representation of this table using JSON.default String
toJson
(JsonOptions... options) Return a representation of this table using JSON.toMap()
Get the elements of this array as aMap
.default String
toToml()
Return a representation of this table using TOML.default void
toToml
(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()true
if there are no entries in this table.- Returns:
true
if 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:
true
if the key was set in the TOML document.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
contains
Check if a key was set in the TOML document.- Parameters:
path
- The key path.- Returns:
true
if the key was set in the TOML document.
-
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
Get all the dotted keys of this table.- Parameters:
includeTables
- Iftrue
, also include paths to intermediary and empty tables.- Returns:
- A set containing all the dotted keys of this table.
-
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
Get all the paths in this table.- Parameters:
includeTables
- Iftrue
, also include paths to intermediary and empty tables.- Returns:
- A set containing all the key paths of this table.
-
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
Get all the dotted entries of this table.- Parameters:
includeTables
- Iftrue
, also include paths to intermediary and empty tables.- Returns:
- A set containing all the entries of this table.
-
entryPathSet
Get all the entries in this table.Paths to intermediary and empty tables are not returned. To include these, use
entryPathSet(boolean)
.- Returns:
- A set containing all the entries of this table.
-
entryPathSet
Get all the entries in this table.- Parameters:
includeTables
- Iftrue
, also include entries in intermediary and empty tables.- Returns:
- A set containing all the entries of this table.
-
get
Get a value from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.address.port"
).- Returns:
- The value, or
null
if 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
null
if 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
null
if 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
null
if 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:
true
if the value can be obtained as a string.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
isString
Check if a value in the TOML document is a string.- Parameters:
path
- The key path.- Returns:
true
if the value can be obtained as a string.
-
getString
Get a string from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.address.hostname"
).- Returns:
- The value, or
null
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 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
null
if 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:
true
if the value can be obtained as a long.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
isLong
Check if a value in the TOML document is a long.- Parameters:
path
- The key path.- Returns:
true
if the value can be obtained as a long.
-
getLong
Get a long from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.address.port"
).- Returns:
- The value, or
null
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 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
null
if 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:
true
if the value can be obtained as a double.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
isDouble
Check if a value in the TOML document is a double.- Parameters:
path
- The key path.- Returns:
true
if the value can be obtained as a double.
-
getDouble
Get a double from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.address.port"
).- Returns:
- The value, or
null
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 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
null
if 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:
true
if the value can be obtained as a boolean.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
isBoolean
Check if a value in the TOML document is a boolean.- Parameters:
path
- The key path.- Returns:
true
if the value can be obtained as a boolean.
-
getBoolean
Get a boolean from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.address.port"
).- Returns:
- The value, or
null
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 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
null
if 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:
true
if 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:
true
if 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
null
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 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
null
if 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:
true
if 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:
true
if 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
null
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 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
null
if 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:
true
if the value can be obtained as aLocalDate
.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
isLocalDate
Check if a value in the TOML document is aLocalDate
.- Parameters:
path
- The key path.- Returns:
true
if the value can be obtained as aLocalDate
.
-
getLocalDate
Get a local date from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.address.port"
).- Returns:
- The value, or
null
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 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
null
if 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:
true
if the value can be obtained as aLocalTime
.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
isLocalTime
Check if a value in the TOML document is aLocalTime
.- Parameters:
path
- The key path.- Returns:
true
if the value can be obtained as aLocalTime
.
-
getLocalTime
Get a local time from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.address.port"
).- Returns:
- The value, or
null
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 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
null
if 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:
true
if the value can be obtained as an array.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
isArray
Check if a value in the TOML document is an array.- Parameters:
path
- The key path.- Returns:
true
if the value can be obtained as an array.
-
getArray
Get an array from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.addresses"
).- Returns:
- The value, or
null
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 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
null
if 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:
true
if the value can be obtained as a table.- Throws:
IllegalArgumentException
- If the key cannot be parsed.
-
isTable
Check if a value in the TOML document is a table.- Parameters:
path
- The key path.- Returns:
true
if the value can be obtained as a table.
-
getTable
Get a table from the TOML document.- Parameters:
dottedKey
- A dotted key (e.g."server.address"
).- Returns:
- The value, or
null
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.
-
getTable
Get a table from the TOML document.- Parameters:
path
- The key path.- Returns:
- The value, or
null
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.
-
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
Get the elements of this array as aMap
.Note that this does not do a deep conversion. If this array contains tables or arrays, they will be of type
TomlTable
orTomlArray
respectively.- Returns:
- The elements of this array as a
Map
.
-
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.
-