public class YAMLSection
extends java.lang.Object
Constructor and Description |
---|
YAMLSection()
Creates an empty YAML Section
|
YAMLSection(java.io.InputStream stream)
Creates a YAML Section from an Input Stream
|
YAMLSection(org.json.JSONObject json)
Creates a YAML Section from JSON Contents
|
YAMLSection(java.io.Reader reader)
Creates a YAML Section from a Reader
|
YAMLSection(java.lang.String str)
Creates a YAML Section from String
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all Objects from this YAML Section
|
YAMLSection |
clone()
Clone this YAML Section
|
boolean |
contains(java.lang.String handle)
Check if a Handle exists
|
YAMLValue |
get(java.lang.String handle)
Get an Object by Handle
|
YAMLValue |
get(java.lang.String handle,
java.lang.Object def)
Get an Object by Handle
|
YAMLValue |
get(java.lang.String handle,
YAMLValue def)
Get an Object by Handle
|
boolean |
getBoolean(java.lang.String handle)
Get a Boolean by Handle
|
boolean |
getBoolean(java.lang.String handle,
boolean def)
Get a Boolean by Handle
|
java.util.List<java.lang.Boolean> |
getBooleanList(java.lang.String handle)
Get a Boolean List by Handle
|
java.util.List<java.lang.Boolean> |
getBooleanList(java.lang.String handle,
java.util.List<java.lang.Boolean> def)
Get a Boolean List by Handle
|
java.lang.String |
getColoredString(java.lang.String handle,
char color)
Get a Colored String by Handle
|
java.lang.String |
getColoredString(java.lang.String handle,
java.lang.String def,
char color)
Get a Colored String by Handle
|
java.util.List<java.lang.String> |
getColoredStringList(java.lang.String handle,
char color)
Get a Colored String List by Handle
|
java.util.List<java.lang.String> |
getColoredStringList(java.lang.String handle,
java.util.List<java.lang.String> def,
char color)
Get a Colored String List by Handle
|
double |
getDouble(java.lang.String handle)
Get a Double by Handle
|
double |
getDouble(java.lang.String handle,
double def)
Get a Double by Handle
|
java.util.List<java.lang.Double> |
getDoubleList(java.lang.String handle)
Get a Double List by Handle
|
java.util.List<java.lang.Double> |
getDoubleList(java.lang.String handle,
java.util.List<java.lang.Double> def)
Get a Double List by Handle
|
float |
getFloat(java.lang.String handle)
Get a Float by Handle
|
float |
getFloat(java.lang.String handle,
float def)
Get a Float by Handle
|
java.util.List<java.lang.Float> |
getFloatList(java.lang.String handle)
Get a Float List by Handle
|
java.util.List<java.lang.Float> |
getFloatList(java.lang.String handle,
float def)
Get a Float List by Handle
|
int |
getInt(java.lang.String handle)
Get an Integer by Handle
|
int |
getInt(java.lang.String handle,
int def)
Get an Integer by Handle
|
java.util.List<java.lang.Integer> |
getIntList(java.lang.String handle)
Get an Integer List by Handle
|
java.util.List<java.lang.Integer> |
getIntList(java.lang.String handle,
java.util.List<java.lang.Integer> def)
Get an Integer List by Handle
|
java.util.Set<java.lang.String> |
getKeys()
Get the Keys
|
java.util.List<YAMLValue> |
getList(java.lang.String handle)
Get a List by Handle
|
java.util.List<YAMLValue> |
getList(java.lang.String handle,
java.util.Collection<?> def)
Get a List by Handle
|
java.util.List<YAMLValue> |
getList(java.lang.String handle,
java.util.List<? extends YAMLValue> def)
Get a List by Handle
|
long |
getLong(java.lang.String handle)
Get a Long by Handle
|
long |
getLong(java.lang.String handle,
long def)
Get a Long by Handle
|
java.util.List<java.lang.Long> |
getLongList(java.lang.String handle)
Get a Long List by Handle
|
java.util.List<java.lang.Long> |
getLongList(java.lang.String handle,
java.util.List<java.lang.Long> def)
Get a Long List by Handle
|
java.lang.Object |
getObject(java.lang.String handle)
Get a Object by Handle
|
java.lang.Object |
getObject(java.lang.String handle,
java.lang.Object def)
Get a Object by Handle
|
java.util.List<?> |
getObjectList(java.lang.String handle)
Get a Object List by Handle
|
java.util.List<?> |
getObjectList(java.lang.String handle,
java.util.List<?> def)
Get a Object List by Handle
|
java.lang.String |
getRawString(java.lang.String handle)
Get an Unparsed String by Handle
|
java.lang.String |
getRawString(java.lang.String handle,
java.lang.String def)
Get an Unparsed String by Handle
|
java.util.List<java.lang.String> |
getRawStringList(java.lang.String handle)
Get an Unparsed String List by Handle
|
java.util.List<java.lang.String> |
getRawStringList(java.lang.String handle,
java.util.List<java.lang.String> def)
Get an Unparsed String List by Handle
|
YAMLSection |
getSection(java.lang.String handle)
Get a YAML Section by Handle
|
YAMLSection |
getSection(java.lang.String handle,
java.util.Map<java.lang.String,?> def)
Get a YAML Section by Handle
|
YAMLSection |
getSection(java.lang.String handle,
YAMLSection def)
Get a YAML Section by Handle
|
java.util.List<YAMLSection> |
getSectionList(java.lang.String handle)
Get a YAML Section List by Handle
|
java.util.List<YAMLSection> |
getSectionList(java.lang.String handle,
java.util.Collection<? extends java.util.Map<java.lang.String,?>> def)
Get a YAML Section List by Handle
|
java.util.List<YAMLSection> |
getSectionList(java.lang.String handle,
java.util.List<? extends YAMLSection> def)
Get a YAML Section List by Handle
|
short |
getShort(java.lang.String handle)
Get a Short by Handle
|
short |
getShort(java.lang.String handle,
short def)
Get a Short by Handle
|
java.util.List<java.lang.Short> |
getShortList(java.lang.String handle)
Get a Short List by Handle
|
java.util.List<java.lang.Short> |
getShortList(java.lang.String handle,
java.util.List<java.lang.Short> def)
Get a Short List by Handle
|
java.lang.String |
getString(java.lang.String handle)
Get a String by Handle
|
java.lang.String |
getString(java.lang.String handle,
java.lang.String def)
Get a String by Handle
|
java.util.List<java.lang.String> |
getStringList(java.lang.String handle)
Get a String List by Handle
|
java.util.List<java.lang.String> |
getStringList(java.lang.String handle,
java.util.List<java.lang.String> def)
Get a String List by Handle
|
java.util.UUID |
getUUID(java.lang.String handle)
Get a UUID by Handle
|
java.util.UUID |
getUUID(java.lang.String handle,
java.util.UUID def)
Get a UUID by Handle
|
java.util.List<java.util.UUID> |
getUUIDList(java.lang.String handle)
Get a UUID List by Handle
|
java.util.List<java.util.UUID> |
getUUIDList(java.lang.String handle,
java.util.List<java.util.UUID> def)
Get a UUID List by Handle
|
java.util.Collection<YAMLValue> |
getValues()
Get the Values
|
boolean |
isBoolean(java.lang.String handle)
Check if object is a Boolean by Handle
|
boolean |
isDouble(java.lang.String handle)
Check if object is a Double by Handle
|
boolean |
isFloat(java.lang.String handle)
Check if object is a Float by Handle
|
boolean |
isInt(java.lang.String handle)
Check if object is an Integer by Handle
|
boolean |
isList(java.lang.String handle)
Check if object is a List by Handle
|
boolean |
isLong(java.lang.String handle)
Check if object is a Long by Handle
|
boolean |
isSection(java.lang.String handle)
Check if object is a YAML Section by Handle
|
boolean |
isString(java.lang.String handle)
Check if object is a String by Handle
|
boolean |
isUUID(java.lang.String handle)
Check if object is a UUID by Handle
|
void |
remove(java.lang.String handle)
Remove an Object by Handle
|
<V> void |
safeSet(java.lang.String handle,
java.util.Collection<V> list)
Set Collection<V> into this YAML Section without overwriting existing value
|
void |
safeSet(java.lang.String handle,
java.lang.Object value)
Set Object into this YAML Section without overwriting existing value
|
<V> void |
safeSet(java.lang.String handle,
V[] array)
Set V[] into this YAML Section without overwriting existing value
|
void |
safeSetAll(java.util.Map<java.lang.String,?> values)
Set All Objects into this YAML Section without overwriting existing values
|
void |
safeSetAll(YAMLSection values)
Copy YAML Values to this YAML Section without overwriting existing values
|
<V> void |
set(java.lang.String handle,
java.util.Collection<V> list)
Set Collection<V> into this YAML Section
|
void |
set(java.lang.String handle,
java.lang.Object value)
Set Object into this YAML Section
|
<V> void |
set(java.lang.String handle,
V[] array)
Set V[] into this YAML Section
|
void |
setAll(java.util.Map<java.lang.String,?> values)
Set All Objects into this YAML Section
|
void |
setAll(YAMLSection values)
Copy YAML Values to this YAML Section
|
YAMLSection |
superSection()
Go up a level in the config (or null if this is the top layer)
|
org.json.JSONObject |
toJSON()
Convert to JSON
|
java.lang.String |
toString() |
public YAMLSection()
public YAMLSection(java.io.InputStream stream) throws org.yaml.snakeyaml.error.YAMLException
stream
- Input Streamorg.yaml.snakeyaml.error.YAMLException
public YAMLSection(java.io.Reader reader) throws org.yaml.snakeyaml.error.YAMLException
reader
- Readerorg.yaml.snakeyaml.error.YAMLException
public YAMLSection(org.json.JSONObject json)
json
- JSONpublic YAMLSection(java.lang.String str) throws org.yaml.snakeyaml.error.YAMLException
str
- Stringorg.yaml.snakeyaml.error.YAMLException
public java.util.Set<java.lang.String> getKeys()
public java.util.Collection<YAMLValue> getValues()
public boolean contains(java.lang.String handle)
handle
- Handlepublic void remove(java.lang.String handle)
handle
- Handlepublic void clear()
public void set(java.lang.String handle, java.lang.Object value)
handle
- Handlevalue
- Valuepublic void safeSet(java.lang.String handle, java.lang.Object value)
handle
- Handlevalue
- Valuepublic <V> void set(java.lang.String handle, V[] array)
V
- Array Typehandle
- Handlearray
- Valuepublic <V> void safeSet(java.lang.String handle, V[] array)
V
- Array Typehandle
- Handlearray
- Valuepublic <V> void set(java.lang.String handle, java.util.Collection<V> list)
V
- Collection Typehandle
- Handlelist
- Valuepublic <V> void safeSet(java.lang.String handle, java.util.Collection<V> list)
V
- Collection Typehandle
- Handlelist
- Valuepublic void setAll(java.util.Map<java.lang.String,?> values)
values
- Map to setpublic void setAll(YAMLSection values)
values
- YAMLSection to mergepublic void safeSetAll(java.util.Map<java.lang.String,?> values)
values
- Map to setpublic void safeSetAll(YAMLSection values)
values
- YAMLSection to mergepublic YAMLSection superSection()
public YAMLSection clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public org.json.JSONObject toJSON()
public YAMLValue get(java.lang.String handle)
handle
- Handlepublic YAMLValue get(java.lang.String handle, java.lang.Object def)
handle
- Handledef
- Defaultpublic YAMLValue get(java.lang.String handle, YAMLValue def)
handle
- Handledef
- Defaultpublic java.util.List<YAMLValue> getList(java.lang.String handle)
handle
- Handlepublic java.util.List<YAMLValue> getList(java.lang.String handle, java.util.Collection<?> def)
handle
- Handledef
- Defaultpublic java.util.List<YAMLValue> getList(java.lang.String handle, java.util.List<? extends YAMLValue> def)
handle
- Handledef
- Defaultpublic java.lang.Object getObject(java.lang.String handle)
handle
- Handlepublic java.lang.Object getObject(java.lang.String handle, java.lang.Object def)
handle
- Handledef
- Defaultpublic java.util.List<?> getObjectList(java.lang.String handle)
handle
- Handlepublic java.util.List<?> getObjectList(java.lang.String handle, java.util.List<?> def)
handle
- Handledef
- Defaultpublic boolean getBoolean(java.lang.String handle)
handle
- Handlepublic boolean getBoolean(java.lang.String handle, boolean def)
handle
- Handledef
- Defaultpublic java.util.List<java.lang.Boolean> getBooleanList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.lang.Boolean> getBooleanList(java.lang.String handle, java.util.List<java.lang.Boolean> def)
handle
- Handledef
- Defaultpublic YAMLSection getSection(java.lang.String handle)
handle
- Handlepublic YAMLSection getSection(java.lang.String handle, java.util.Map<java.lang.String,?> def)
handle
- Handledef
- Defaultpublic YAMLSection getSection(java.lang.String handle, YAMLSection def)
handle
- Handledef
- Defaultpublic java.util.List<YAMLSection> getSectionList(java.lang.String handle)
handle
- Handlepublic java.util.List<YAMLSection> getSectionList(java.lang.String handle, java.util.Collection<? extends java.util.Map<java.lang.String,?>> def)
handle
- Handledef
- Defaultpublic java.util.List<YAMLSection> getSectionList(java.lang.String handle, java.util.List<? extends YAMLSection> def)
handle
- Handledef
- Defaultpublic double getDouble(java.lang.String handle)
handle
- Handlepublic double getDouble(java.lang.String handle, double def)
handle
- Handledef
- Defaultpublic java.util.List<java.lang.Double> getDoubleList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.lang.Double> getDoubleList(java.lang.String handle, java.util.List<java.lang.Double> def)
handle
- Handledef
- Defaultpublic float getFloat(java.lang.String handle)
handle
- Handlepublic float getFloat(java.lang.String handle, float def)
handle
- Handledef
- Defaultpublic java.util.List<java.lang.Float> getFloatList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.lang.Float> getFloatList(java.lang.String handle, float def)
handle
- Handledef
- Defaultpublic int getInt(java.lang.String handle)
handle
- Handlepublic int getInt(java.lang.String handle, int def)
handle
- Handledef
- Defaultpublic java.util.List<java.lang.Integer> getIntList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.lang.Integer> getIntList(java.lang.String handle, java.util.List<java.lang.Integer> def)
handle
- Handledef
- Defaultpublic long getLong(java.lang.String handle)
handle
- Handlepublic long getLong(java.lang.String handle, long def)
handle
- Handledef
- Defaultpublic java.util.List<java.lang.Long> getLongList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.lang.Long> getLongList(java.lang.String handle, java.util.List<java.lang.Long> def)
handle
- Handledef
- Defaultpublic short getShort(java.lang.String handle)
handle
- Handlepublic short getShort(java.lang.String handle, short def)
handle
- Handledef
- Defaultpublic java.util.List<java.lang.Short> getShortList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.lang.Short> getShortList(java.lang.String handle, java.util.List<java.lang.Short> def)
handle
- Handledef
- Defaultpublic java.lang.String getRawString(java.lang.String handle)
handle
- Handlepublic java.lang.String getRawString(java.lang.String handle, java.lang.String def)
handle
- Handledef
- Defaultpublic java.util.List<java.lang.String> getRawStringList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.lang.String> getRawStringList(java.lang.String handle, java.util.List<java.lang.String> def)
handle
- Handledef
- Defaultpublic java.lang.String getString(java.lang.String handle)
handle
- Handlepublic java.lang.String getString(java.lang.String handle, java.lang.String def)
handle
- Handledef
- Defaultpublic java.util.List<java.lang.String> getStringList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.lang.String> getStringList(java.lang.String handle, java.util.List<java.lang.String> def)
handle
- Handledef
- Defaultpublic java.lang.String getColoredString(java.lang.String handle, char color)
handle
- Handlecolor
- Color Char to parsepublic java.lang.String getColoredString(java.lang.String handle, java.lang.String def, char color)
handle
- Handledef
- Defaultcolor
- Color Char to parsepublic java.util.List<java.lang.String> getColoredStringList(java.lang.String handle, char color)
handle
- Handlecolor
- Color Char to parsepublic java.util.List<java.lang.String> getColoredStringList(java.lang.String handle, java.util.List<java.lang.String> def, char color)
handle
- Handledef
- Defaultcolor
- Color Char to parsepublic java.util.UUID getUUID(java.lang.String handle)
handle
- Handlepublic java.util.UUID getUUID(java.lang.String handle, java.util.UUID def)
handle
- Handledef
- Defaultpublic java.util.List<java.util.UUID> getUUIDList(java.lang.String handle)
handle
- Handlepublic java.util.List<java.util.UUID> getUUIDList(java.lang.String handle, java.util.List<java.util.UUID> def)
handle
- Handledef
- Defaultpublic boolean isBoolean(java.lang.String handle)
handle
- Handlepublic boolean isSection(java.lang.String handle)
handle
- Handlepublic boolean isDouble(java.lang.String handle)
handle
- Handlepublic boolean isFloat(java.lang.String handle)
handle
- Handlepublic boolean isInt(java.lang.String handle)
handle
- Handlepublic boolean isList(java.lang.String handle)
handle
- Handlepublic boolean isLong(java.lang.String handle)
handle
- Handlepublic boolean isString(java.lang.String handle)
handle
- Handlepublic boolean isUUID(java.lang.String handle)
handle
- Handle