public interface TomlArray
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsArrays() |
boolean |
containsBooleans() |
boolean |
containsDoubles() |
boolean |
containsLocalDates() |
boolean |
containsLocalDateTimes() |
boolean |
containsLocalTimes() |
boolean |
containsLongs() |
boolean |
containsOffsetDateTimes() |
boolean |
containsStrings() |
boolean |
containsTables() |
java.lang.Object |
get(int index)
Get a value at a specified index.
|
default TomlArray |
getArray(int index)
Get an array at a specified index.
|
default boolean |
getBoolean(int index)
Get a boolean at a specified index.
|
default double |
getDouble(int index)
Get a double at a specified index.
|
default java.time.LocalDate |
getLocalDate(int index)
Get a local date at a specified index.
|
default java.time.LocalDateTime |
getLocalDateTime(int index)
Get a local date time at a specified index.
|
default java.time.LocalTime |
getLocalTime(int index)
Get a local time at a specified index.
|
default long |
getLong(int index)
Get a long at a specified index.
|
default java.time.OffsetDateTime |
getOffsetDateTime(int index)
Get an offset date time at a specified index.
|
default java.lang.String |
getString(int index)
Get a string at a specified index.
|
default TomlTable |
getTable(int index)
Get a table at a specified index.
|
TomlPosition |
inputPositionOf(int index)
Get the position where a value is defined in the TOML document.
|
boolean |
isEmpty() |
int |
size() |
default java.lang.String |
toJson()
Return a representation of this array using JSON.
|
default void |
toJson(java.lang.Appendable appendable)
Append a JSON representation of this array to the appendable output.
|
java.util.List<java.lang.Object> |
toList()
Get the elements of this array as a
List. |
int size()
boolean isEmpty()
true if the array is empty.boolean containsStrings()
true if the array contains strings.boolean containsLongs()
true if the array contains longs.boolean containsDoubles()
true if the array contains doubles.boolean containsBooleans()
true if the array contains booleans.boolean containsOffsetDateTimes()
true if the array contains OffsetDateTimes.boolean containsLocalDateTimes()
true if the array contains LocalDateTimes.boolean containsLocalDates()
true if the array contains LocalDates.boolean containsLocalTimes()
true if the array contains LocalTimes.boolean containsArrays()
true if the array contains arrays.boolean containsTables()
true if the array contains tables.java.lang.Object get(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlPosition inputPositionOf(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.default java.lang.String getString(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not a long.default long getLong(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not a long.default double getDouble(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not a long.default boolean getBoolean(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not a long.default java.time.OffsetDateTime getOffsetDateTime(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not an OffsetDateTime.default java.time.LocalDateTime getLocalDateTime(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not an LocalDateTime.default java.time.LocalDate getLocalDate(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not an LocalDate.default java.time.LocalTime getLocalTime(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not an LocalTime.default TomlArray getArray(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not an array.default TomlTable getTable(int index)
index - The array index.java.lang.IndexOutOfBoundsException - If the index is out of bounds.TomlInvalidTypeException - If the value is not a table.java.util.List<java.lang.Object> toList()
List.
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.
List.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.