public class TomlTable extends HashMap<String,Object>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
TomlTable() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
asObject(Class<T> type)
Returns an instance of
type filled by the properties here |
Object |
get(String key,
Object... keys)
Returns the object in the given path or null if it does not exist
|
List<TomlTable> |
getArrayTable(String name,
Object... keys) |
<T extends Enum<T>> |
getAsEnum(Class<T> type,
String name,
Object... keys)
Returns an instance of the enum T corresponding to the value in the local key name
If the local value is null, null will be returned
If the local value is a long, the enum constant with that ordinal is returned
If the local value is a String, the enum constant is returned using the enum's valueOf method.
|
Boolean |
getBoolean(String name,
Object... keys) |
Date |
getDate(String name,
Object... keys) |
Double |
getDouble(String name,
Object... keys) |
List<?> |
getList(String name,
Object... keys) |
Long |
getLong(String name,
Object... keys) |
String |
getString(String name,
Object... keys) |
TomlTable |
getTomlTable(String name,
Object... keys) |
Object |
getValue(String bar,
Object... keys)
Convenience method, mainly to keep the old signature
|
Map<String,Object> |
toMap()
Returns an unmodifiable map of this Toml Table.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, valuesequals, hashCode, toStringpublic Object get(String key, Object... keys) throws IllegalArgumentException
key - the key under this tablekeys - subsequent keys, each is either a string for a property name in a Table or an integer for an index in an ArrayIllegalArgumentException - if one of the keys goes through a value (such as a String), or isn't an index for going through an arraypublic Object getValue(String bar, Object... keys)
bar - public String getString(String name, Object... keys) throws ClassCastException
ClassCastExceptionpublic Long getLong(String name, Object... keys) throws ClassCastException
ClassCastExceptionpublic Double getDouble(String name, Object... keys) throws ClassCastException
ClassCastExceptionpublic Date getDate(String name, Object... keys) throws ClassCastException
ClassCastExceptionpublic List<?> getList(String name, Object... keys) throws ClassCastException
ClassCastExceptionpublic List<TomlTable> getArrayTable(String name, Object... keys) throws ClassCastException
ClassCastExceptionpublic Boolean getBoolean(String name, Object... keys) throws ClassCastException
ClassCastExceptionpublic TomlTable getTomlTable(String name, Object... keys) throws ClassCastException
ClassCastExceptionpublic <T extends Enum<T>> T getAsEnum(Class<T> type, String name, Object... keys)
T - name - type - IllegalArgumentException - if the value is neither of type String or IntegerObjectDeserializer.toEnum(Class, Object)public <T> T asObject(Class<T> type)
type filled by the properties heretype - Copyright © 2017. All rights reserved.