Package net.gcnt.additionsplus.api.files
Interface YAMLSection
- All Known Subinterfaces:
AdditionsPlayerManager
,YAMLConfig
public interface YAMLSection
Custom YAML section to handle all data retrieval from YAML files.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check whether the config contains the property.Get an object.Get an object.boolean
getBoolean
(String property) Get a boolean.boolean
getBoolean
(String property, boolean defaultValue) Get a boolean.double
Get a double.double
Get a double.getEnchantments
(String property) Get aHashMap
ofEnchantment
and their strengths.int
Get an integer.int
Get an integer.Get theAdditionsItem
from the current section.List<org.bukkit.inventory.ItemFlag>
getItemFlags
(String property) Get aList
ofItemFlag
.getItemOptions
(String property) Get aList
ofItemOption
.Get aSet
of keys.long
Get a long.long
Get a long.getMessage
(String property) Get a message to send as chat/title.getMessage
(String property, String def) Get a message to send as chat/title.getMessage
(String property, List<String> def) Get a message to send as chat/title.getSection
(String property) Get a YAML section by key.Get a string.Get a string.getStringList
(String property) Get aList
of strings.getStringMap
(String property) Get a string map.boolean
Check whether a property has been set.void
save()
Save the cached YAML file to the file system.void
Set a value to a key in the yaml config
-
Method Details
-
save
void save()Save the cached YAML file to the file system. This will get rid of the comments! -
getString
Get a string.- Parameters:
property
- Property to get the value of.- Returns:
String
value.
-
getString
Get a string. -
getInt
Get an integer.- Parameters:
property
- Property to get the value of.- Returns:
Integer
value.
-
getInt
Get an integer. -
getLong
Get a long.- Parameters:
property
- Property to get the value of.- Returns:
Long
value.
-
getLong
Get a long. -
getStringList
Get aList
of strings.- Parameters:
property
- Property to get the value of.- Returns:
List
of strings.
-
getStringMap
Get a string map.- Parameters:
property
- Property to get the value of.- Returns:
Map
of the keys and their values.
-
getDouble
Get a double.- Parameters:
property
- Property to get the value of.- Returns:
Double
value.
-
getDouble
Get a double. -
getBoolean
Get a boolean.- Parameters:
property
- Property to get the value of.- Returns:
Boolean
value.
-
getBoolean
Get a boolean. -
get
Get an object.- Parameters:
property
- Property to get the value of.- Returns:
Object
value.
-
get
Get an object. -
isSet
Check whether a property has been set.- Parameters:
property
- Property to check.- Returns:
- True when set, false otherwise.
-
contains
Check whether the config contains the property.- Parameters:
property
- Property to check.- Returns:
- True on existence, false otherwise.
-
getKeys
Get aSet
of keys.- Parameters:
property
- Property to get the value of.- Returns:
Set
of keys.
-
getMessage
Get a message to send as chat/title.- Parameters:
property
- Property to get the value of.- Returns:
Message
object with the message.
-
getMessage
Get a message to send as chat/title.- Parameters:
property
- Property to get the value of.def
- Default value.- Returns:
Message
object with the message.
-
getMessage
Get a message to send as chat/title. -
getSection
Get a YAML section by key.- Parameters:
property
- Property to get the section of.- Returns:
- YAML section when found, null otherwise.
-
getItem
Get theAdditionsItem
from the current section. This searches the entire section for usable options.- Parameters:
identifier
- The identifier of the item.- Returns:
AdditionsItem
when found, null otherwise.
-
getEnchantments
Get aHashMap
ofEnchantment
and their strengths.- Parameters:
property
- Property to get the value of.- Returns:
HashMap
ofEnchantment
and their strengths.
-
getItemFlags
Get aList
ofItemFlag
.- Parameters:
property
- Property to get the value of.- Returns:
List
ofItemFlag
.
-
getItemOptions
Get aList
ofItemOption
.- Parameters:
property
- Property to get the value of.- Returns:
List
ofItemOption
.
-
set
Set a value to a key in the yaml config- Parameters:
property
- The key to save the data to.value
- The value to save.
-