public interface ConfigurationArray
extends java.lang.Iterable<java.lang.Object>
Modifier and Type | Method and Description |
---|---|
default java.lang.Object |
get(int i)
Gets the object stored at index i.
|
boolean |
getBoolean(int i)
Gets the boolean stored at index i.
|
Configuration |
getConfiguration(int i)
Gets the Configuration stored at index i.
|
ConfigurationArray |
getInner(int i)
Gets the ConfigurationArray stored at index i.
|
java.lang.Number |
getNumber(int i)
Gets the number stored at index i.
|
default java.lang.Object[] |
getRawData()
Gets an array of the raw data stored in this configuration array.
|
default <T> T[] |
getRawDataOfType(java.lang.Class<T> clazz)
Gets an array of the raw data stored in this configuration array.
|
java.lang.String |
getString(int i)
Gets the String stored at index i.
|
default boolean |
hasBoolean(int i)
Returns whether there is a boolean stored at index i.
|
default boolean |
hasConfiguration(int i)
Returns whether there is a Configuration stored at index i.
|
default boolean |
hasInner(int i)
Returns whether there is a ConfigurationArray stored at index i.
|
default boolean |
hasNumber(int i)
Returns whether there is a number stored at index i.
|
default boolean |
hasString(int i)
Returns whether there is a String stored at index i.
|
default java.util.Iterator<java.lang.Object> |
iterator()
Returns an iterator through the array.
|
int |
size()
The size of the array.
|
default java.util.Optional<java.lang.Boolean> |
tryGetBoolean(int i)
Safe version to get the boolean stored at index i.
|
default java.util.Optional<Configuration> |
tryGetConfiguration(int i)
Safe version to get the Configuration stored at index i.
|
default java.util.Optional<ConfigurationArray> |
tryGetInner(int i)
Safe version to get the ConfigurationArray stored at index i.
|
default java.util.Optional<java.lang.Number> |
tryGetNumber(int i)
Safe version to get the number stored at index i.
|
default java.util.Optional<java.lang.String> |
tryGetString(int i)
Safe version to get the String stored at index i.
|
int size()
get(int)
is certain to return an object for any
index in [0, size).java.lang.Number getNumber(int i) throws NoSuchPropertyException
i
- The index.NoSuchPropertyException
- If there is no number stored at the given index.default java.util.Optional<java.lang.Number> tryGetNumber(int i)
i
- The index.default boolean hasNumber(int i)
getNumber(int)
will not throw an exception and tryGetNumber(int)
won't return an empty optional.i
- The index.boolean getBoolean(int i) throws NoSuchPropertyException
i
- The index.NoSuchPropertyException
- If there is no boolean stored at the given index.default java.util.Optional<java.lang.Boolean> tryGetBoolean(int i)
i
- The index.default boolean hasBoolean(int i)
getBoolean(int)
will not throw an exception and tryGetBoolean(int)
won't return an empty optional.i
- The index.java.lang.String getString(int i) throws NoSuchPropertyException
i
- The index.NoSuchPropertyException
- If there is no String stored at the given index.default java.util.Optional<java.lang.String> tryGetString(int i)
i
- The index.default boolean hasString(int i)
getString(int)
will not throw an exception and tryGetString(int)
won't return an empty optional.i
- The index.Configuration getConfiguration(int i) throws NoSuchPropertyException
i
- The index.NoSuchPropertyException
- If there is no Configuration stored at the given index.default java.util.Optional<Configuration> tryGetConfiguration(int i)
i
- The index.default boolean hasConfiguration(int i)
getConfiguration(int)
will not throw an exception and tryGetConfiguration(int)
won't return an empty optional.i
- The index.ConfigurationArray getInner(int i) throws NoSuchPropertyException
i
- The index.NoSuchPropertyException
- If there is no ConfigurationArray stored at the given index.default java.util.Optional<ConfigurationArray> tryGetInner(int i)
i
- The index.default boolean hasInner(int i)
getInner(int)
will not throw an exception and tryGetInner(int)
won't return an empty optional.i
- The index.default java.lang.Object get(int i)
i
- The index.java.lang.IndexOutOfBoundsException
- If the given index is not in the interval [0, size()).default java.lang.Object[] getRawData()
default <T> T[] getRawDataOfType(java.lang.Class<T> clazz)
default java.util.Iterator<java.lang.Object> iterator()
iterator
in interface java.lang.Iterable<java.lang.Object>