public interface ConfigNode
Modifier and Type | Method and Description |
---|---|
ConfigNode |
child(java.lang.String key)
Get child node by key
|
java.util.List<ConfigNode> |
childrenList()
Get list of children if node is list
|
java.util.Map<java.lang.String,ConfigNode> |
childrenMap()
Get map of children if node is map
|
default boolean |
getBoolean()
Get boolean value or false as default
|
boolean |
getBoolean(boolean def)
Get boolean value
|
default double |
getDouble()
Get double value or 0 as default
|
double |
getDouble(double def)
Get double value
|
default float |
getFloat()
Get float value or 0 as default
|
float |
getFloat(float def)
Get float value
|
default int |
getInt()
Get int value or 0 as default
|
int |
getInt(int def)
Get int value
|
<T> java.util.List<T> |
getList(java.lang.Class<T> type)
Get deserialized list of values
|
default long |
getLong()
Get long value or 0 as default
|
long |
getLong(long def)
Get long value
|
default java.lang.String |
getString()
Get String value or null as default
|
java.lang.String |
getString(java.lang.String def)
Get String value
|
default <T> T |
getValue(java.lang.Class<T> type)
Get deserialized value
|
<T> T |
getValue(java.lang.Class<T> type,
T def)
Get deserialized value
|
boolean |
hasChildren()
Is ths node has children.
|
boolean |
isList()
Is this node a list
|
boolean |
isMap()
Is this node a map
|
boolean |
isNull()
Is this node a null
|
boolean |
isPrimitive()
Is this node a primitive (boolean, number, string)
|
java.lang.String |
key()
Get node key
|
ConfigNode |
node(java.lang.String... path)
Get child node by path
|
ConfigNode |
parent()
Get parent of this node
|
java.lang.String[] |
path()
Get path to this node
|
java.lang.Object |
rawValue()
Get raw native Java value
|
ru.abstractmenus.hocon.ConfigValue |
wrapped()
Get wrapped config value
|
ru.abstractmenus.hocon.ConfigValue wrapped()
java.lang.String key()
java.lang.String[] path()
ConfigNode parent()
ConfigNode node(java.lang.String... path)
path
- Relative path to child nodeConfigNode child(java.lang.String key)
key
- Key of child nodeboolean hasChildren()
boolean isList()
boolean isMap()
boolean isPrimitive()
boolean isNull()
java.lang.Object rawValue()
default <T> T getValue(java.lang.Class<T> type) throws NodeSerializeException
T
- Type of the valuetype
- Type of the valueNodeSerializeException
- in cases when object cannot be deserialized<T> T getValue(java.lang.Class<T> type, T def) throws NodeSerializeException
T
- Type of the valuetype
- Type of the valuedef
- default value returned if value absentNodeSerializeException
- in cases when object cannot be deserialized<T> java.util.List<T> getList(java.lang.Class<T> type) throws NodeSerializeException
T
- Type of the valuetype
- Type of the valueNodeSerializeException
- in cases when object cannot be deserializedjava.util.List<ConfigNode> childrenList()
java.util.Map<java.lang.String,ConfigNode> childrenMap()
boolean getBoolean(boolean def)
def
- value that will be returned if node is nulldefault boolean getBoolean()
int getInt(int def)
def
- value that will be returned if node is nulldefault int getInt()
long getLong(long def)
def
- value that will be returned if node is nulldefault long getLong()
float getFloat(float def)
def
- value that will be returned if node is nulldefault float getFloat()
double getDouble(double def)
def
- value that will be returned if node is nulldefault double getDouble()
java.lang.String getString(java.lang.String def)
def
- value that will be returned if node is nulldefault java.lang.String getString()