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.util.Map<java.lang.String,?> map)
Creates a YAML Section from Map 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
|
boolean |
equals(java.lang.Object object) |
java.util.Map<java.lang.String,?> |
get()
Get a copy of the original Object Map
|
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
|
java.lang.Boolean |
getBoolean(java.lang.String handle)
Get a Boolean by Handle
|
java.lang.Boolean |
getBoolean(java.lang.String handle,
java.lang.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
|
java.lang.Double |
getDouble(java.lang.String handle)
Get a Double by Handle
|
java.lang.Double |
getDouble(java.lang.String handle,
java.lang.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
|
java.lang.Float |
getFloat(java.lang.String handle)
Get a Float by Handle
|
java.lang.Float |
getFloat(java.lang.String handle,
java.lang.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,
java.util.List<java.lang.Float> def)
Get a Float List by Handle
|
java.lang.Integer |
getInt(java.lang.String handle)
Get an Integer by Handle
|
java.lang.Integer |
getInt(java.lang.String handle,
java.lang.Integer 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
|
java.lang.Long |
getLong(java.lang.String handle)
Get a Long by Handle
|
java.lang.Long |
getLong(java.lang.String handle,
java.lang.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
|
java.lang.Short |
getShort(java.lang.String handle)
Get a Short by Handle
|
java.lang.Short |
getShort(java.lang.String handle,
java.lang.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 |
isList(java.lang.String handle)
Check if object is a List by Handle
|
boolean |
isNull(java.lang.String handle)
Check if object is Null by Handle
|
boolean |
isNumber(java.lang.String handle)
Check if object is a Number 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(java.lang.String str) throws org.yaml.snakeyaml.error.YAMLException
str
- Stringorg.yaml.snakeyaml.error.YAMLException
public YAMLSection(org.json.JSONObject json)
json
- JSONpublic YAMLSection(java.util.Map<java.lang.String,?> map)
map
- Mappublic java.util.Map<java.lang.String,?> get()
public java.util.Set<java.lang.String> getKeys()
public java.util.Collection<YAMLValue> getValues()
public boolean contains(java.lang.String handle)
handle
- Handlepublic 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 safeSetAll(java.util.Map<java.lang.String,?> values)
values
- Map to setpublic void setAll(YAMLSection values)
values
- YAMLSection to mergepublic void safeSetAll(YAMLSection values)
values
- YAMLSection to mergepublic void remove(java.lang.String handle)
handle
- Handlepublic void clear()
public YAMLSection clone()
clone
in class java.lang.Object
public YAMLSection superSection()
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 java.lang.Boolean getBoolean(java.lang.String handle)
handle
- Handlepublic java.lang.Boolean getBoolean(java.lang.String handle, java.lang.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 java.lang.Double getDouble(java.lang.String handle)
handle
- Handlepublic java.lang.Double getDouble(java.lang.String handle, java.lang.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 java.lang.Float getFloat(java.lang.String handle)
handle
- Handlepublic java.lang.Float getFloat(java.lang.String handle, java.lang.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, java.util.List<java.lang.Float> def)
handle
- Handledef
- Defaultpublic java.lang.Integer getInt(java.lang.String handle)
handle
- Handlepublic java.lang.Integer getInt(java.lang.String handle, java.lang.Integer 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 java.lang.Long getLong(java.lang.String handle)
handle
- Handlepublic java.lang.Long getLong(java.lang.String handle, java.lang.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 java.lang.Short getShort(java.lang.String handle)
handle
- Handlepublic java.lang.Short getShort(java.lang.String handle, java.lang.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 isNull(java.lang.String handle)
handle
- Handlepublic boolean isBoolean(java.lang.String handle)
handle
- Handlepublic boolean isSection(java.lang.String handle)
handle
- Handlepublic boolean isList(java.lang.String handle)
handle
- Handlepublic boolean isNumber(java.lang.String handle)
handle
- Handlepublic boolean isString(java.lang.String handle)
handle
- Handlepublic boolean isUUID(java.lang.String handle)
handle
- Handlepublic boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public org.json.JSONObject toJSON()