Package valorless.valorlessutils.file
Class YamlFile
java.lang.Object
org.bukkit.configuration.MemorySection
org.bukkit.configuration.MemoryConfiguration
org.bukkit.configuration.file.FileConfiguration
org.bukkit.configuration.file.YamlConfiguration
valorless.valorlessutils.file.FileStorage
valorless.valorlessutils.file.YamlFile
- All Implemented Interfaces:
- org.bukkit.configuration.Configuration,- org.bukkit.configuration.ConfigurationSection
- 
Field SummaryFields inherited from class org.bukkit.configuration.file.YamlConfigurationBLANK_CONFIG, COMMENT_PREFIXFields inherited from class org.bukkit.configuration.MemoryConfigurationdefaults, optionsFields inherited from class org.bukkit.configuration.MemorySectionmap
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanChecks if the YamlConfiguration contains a value at the specified path.Gets a value from the YamlConfiguration.<T> TGets a typed value from the YamlConfiguration.org.bukkit.configuration.file.YamlConfigurationGets the underlying YamlConfiguration.<T> TgetOrDefault(String path, T defaultValue) Gets a value from the YamlConfiguration or a default value if the path does not exist.org.bukkit.configuration.ConfigurationSectiongetSection(String path) Gets a ConfigurationSection from the YamlConfiguration.voidreload()Reloads the YamlConfiguration from the associated file.booleansave()Saves the YamlConfiguration to the associated file.voidSets a value in the YamlConfiguration.voidSets a value in the YamlConfiguration only if the path does not already exist.Methods inherited from class valorless.valorlessutils.file.FileStoragecreateFile, deleteFile, fileExists, getFile, loadConfigurationMethods inherited from class org.bukkit.configuration.file.YamlConfigurationloadConfiguration, loadFromString, options, saveToStringMethods inherited from class org.bukkit.configuration.file.FileConfigurationbuildHeader, load, load, load, save, saveMethods inherited from class org.bukkit.configuration.MemoryConfigurationaddDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultsMethods inherited from class org.bukkit.configuration.MemorySectioncontains, createPath, createPath, createSection, createSection, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isPrimitiveWrapper, isSet, isString, isVector, mapChildrenKeys, mapChildrenValues, setComments, setInlineComments, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.configuration.ConfigurationSectioncontains, createSection, createSection, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isSet, isString, isVector, setComments, setInlineComments
- 
Constructor Details- 
YamlFileConstructor for YamlFile class using a file path.- Parameters:
- file- The file path as a string.
 
- 
YamlFileConstructor for YamlFile class using a File object.- Parameters:
- file- The File object representing the YAML file.
 
 
- 
- 
Method Details- 
reloadpublic void reload()Reloads the YamlConfiguration from the associated file.
- 
setSets a value in the YamlConfiguration.- Specified by:
- setin interface- org.bukkit.configuration.ConfigurationSection
- Overrides:
- setin class- org.bukkit.configuration.MemorySection
- Parameters:
- path- The path to the value.
- value- The value to set.
 
- 
getGets a value from the YamlConfiguration.- Specified by:
- getin interface- org.bukkit.configuration.ConfigurationSection
- Overrides:
- getin class- org.bukkit.configuration.MemorySection
- Parameters:
- path- The path to the value.
- Returns:
- The value at the specified path.
 
- 
getGets a typed value from the YamlConfiguration.- Type Parameters:
- T- The type of the value.
- Parameters:
- path- The path to the value.
- clazz- The class of the value.
- Returns:
- The typed value at the specified path.
 
- 
containsChecks if the YamlConfiguration contains a value at the specified path.- Specified by:
- containsin interface- org.bukkit.configuration.ConfigurationSection
- Overrides:
- containsin class- org.bukkit.configuration.MemorySection
- Parameters:
- path- The path to check.
- Returns:
- true if the path exists, false otherwise.
 
- 
setIfNullSets a value in the YamlConfiguration only if the path does not already exist.- Parameters:
- path- The path to the value.
- value- The value to set.
 
- 
getOrDefaultGets a value from the YamlConfiguration or a default value if the path does not exist.- Type Parameters:
- T- The type of the value.
- Parameters:
- path- The path to the value.
- defaultValue- The default value to return if the path does not exist.
- Returns:
- The value at the specified path or the default value if the path does not exist.
 
- 
getSectionGets a ConfigurationSection from the YamlConfiguration.- Parameters:
- path- The path to the ConfigurationSection.
- Returns:
- The ConfigurationSection at the specified path.
 
- 
savepublic boolean save()Saves the YamlConfiguration to the associated file.- Returns:
- true if the save is successful, false otherwise.
 
- 
getConfigpublic org.bukkit.configuration.file.YamlConfiguration getConfig()Gets the underlying YamlConfiguration.- Returns:
- The YamlConfiguration instance.
 
 
-