Interface TomlArray
- All Known Implementing Classes:
EmptyTomlArray, MutableHomogeneousTomlArray, MutableTomlArray
@DefaultQualifier(value=org.checkerframework.checker.nullness.qual.NonNull.class,
locations={RETURN,PARAMETER,FIELD})
public interface TomlArray
An array of TOML values.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.booleanDeprecated.Future releases will support heterogeneous arrays and this method will be removed.get(int index) Get a value at a specified index.default TomlArraygetArray(int index) Get an array at a specified index.default booleangetBoolean(int index) Get a boolean at a specified index.default doublegetDouble(int index) Get a double at a specified index.default LocalDategetLocalDate(int index) Get a local date at a specified index.default LocalDateTimegetLocalDateTime(int index) Get a local date time at a specified index.default LocalTimegetLocalTime(int index) Get a local time at a specified index.default longgetLong(int index) Get a long at a specified index.default OffsetDateTimegetOffsetDateTime(int index) Get an offset date time at a specified index.default StringgetString(int index) Get a string at a specified index.default TomlTablegetTable(int index) Get a table at a specified index.inputPositionOf(int index) Get the position where a value is defined in the TOML document.booleanisEmpty()trueif the array is empty.intsize()The size of the array.default voidtoJson(Appendable appendable, EnumSet<JsonOptions> options) Append a JSON representation of this array to the appendable output.default voidtoJson(Appendable appendable, JsonOptions... options) Append a JSON representation of this array to the appendable output.default StringtoJson(EnumSet<JsonOptions> options) Return a representation of this array using JSON.default StringtoJson(JsonOptions... options) Return a representation of this array using JSON.toList()Get the elements of this array as aList.default StringtoToml()Return a representation of this array using TOML.default voidtoToml(Appendable appendable) Append a TOML representation of this array to the appendable output.
-
Method Details
-
size
int size()The size of the array.- Returns:
- The size of the array.
-
isEmpty
boolean isEmpty()trueif the array is empty.- Returns:
trueif the array is empty.
-
containsStrings
boolean containsStrings()Deprecated.Future releases will support heterogeneous arrays and this method will be removed.trueif the array contains strings.- Returns:
trueif the array contains strings.
-
containsLongs
boolean containsLongs()Deprecated.Future releases will support heterogeneous arrays and this method will be removed.trueif the array contains longs.- Returns:
trueif the array contains longs.
-
containsDoubles
boolean containsDoubles()Deprecated.Future releases will support heterogeneous arrays and this method will be removed.trueif the array contains doubles.- Returns:
trueif the array contains doubles.
-
containsBooleans
boolean containsBooleans()Deprecated.Future releases will support heterogeneous arrays and this method will be removed.trueif the array contains booleans.- Returns:
trueif the array contains booleans.
-
containsOffsetDateTimes
boolean containsOffsetDateTimes()Deprecated.Future releases will support heterogeneous arrays and this method will be removed.trueif the array containsOffsetDateTimes.- Returns:
trueif the array containsOffsetDateTimes.
-
containsLocalDateTimes
boolean containsLocalDateTimes()Deprecated.Future releases will support heterogeneous arrays and this method will be removed.trueif the array containsLocalDateTimes.- Returns:
trueif the array containsLocalDateTimes.
-
containsLocalDates
-
containsLocalTimes
-
containsArrays
boolean containsArrays()Deprecated.Future releases will support heterogeneous arrays and this method will be removed.trueif the array contains arrays.- Returns:
trueif the array contains arrays.
-
containsTables
boolean containsTables()Deprecated.Future releases will support heterogeneous arrays and this method will be removed.trueif the array contains tables.- Returns:
trueif the array contains tables.
-
get
Get a value at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.
-
inputPositionOf
Get the position where a value is defined in the TOML document.- Parameters:
index- The array index.- Returns:
- The input position.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.
-
getString
Get a string at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not a long.
-
getLong
default long getLong(int index) Get a long at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not a long.
-
getDouble
default double getDouble(int index) Get a double at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not a long.
-
getBoolean
default boolean getBoolean(int index) Get a boolean at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not a long.
-
getOffsetDateTime
Get an offset date time at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not anOffsetDateTime.
-
getLocalDateTime
Get a local date time at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not anLocalDateTime.
-
getLocalDate
Get a local date at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not anLocalDate.
-
getLocalTime
Get a local time at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not anLocalTime.
-
getArray
Get an array at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not an array.
-
getTable
Get a table at a specified index.- Parameters:
index- The array index.- Returns:
- The value.
- Throws:
IndexOutOfBoundsException- If the index is out of bounds.TomlInvalidTypeException- If the value is not a table.
-
toList
-
toJson
Return a representation of this array using JSON.- Parameters:
options- Options for the JSON encoder.- Returns:
- A JSON representation of this table.
-
toJson
Return a representation of this array using JSON.- Parameters:
options- Options for the JSON encoder.- Returns:
- A JSON representation of this table.
-
toJson
Append a JSON representation of this array 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 array 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 array using TOML.- Returns:
- A TOML representation of this array.
-
toToml
Append a TOML representation of this array to the appendable output.- Parameters:
appendable- The appendable output.- Throws:
IOException- If an IO error occurs.
-