Class MemorySectionMethods<T extends AbstractMemorySection<?>>
java.lang.Object
com.kamikazejam.kamicommon.yaml.AbstractMemorySection<T>
com.kamikazejam.kamicommon.yaml.base.MemorySectionMethods<T>
- Direct Known Subclasses:
MemorySection,MemorySectionStandalone
public abstract class MemorySectionMethods<T extends AbstractMemorySection<?>>
extends AbstractMemorySection<T>
-
Constructor Summary
ConstructorsConstructorDescriptionMemorySectionMethods(@Nullable org.yaml.snakeyaml.nodes.MappingNode node, @Nullable ConfigurationMethods<?> parent) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDefault(String key, Object o) booleangetBigDecimal(String key) getBigDecimal(String key, BigDecimal def) booleangetBoolean(String key) booleangetBoolean(String key, boolean def) bytebytegetByteList(String key) getByteList(String key, List<Byte> def) doubledoublefloatfloatintintgetIntegerList(String key) getIntegerList(String key, List<Integer> def) getKeys(boolean deep) Returns the keys of the config If Deep is enabled, it will dig and find all valid keys that resolve to a valueList<?> List<?> longlongshortshortgetStringList(String key) getStringList(String key, List<String> def) booleanbooleanbooleanbooleanbooleanisEmpty()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidputBoolean(String key, boolean value) voidvoidvoidvoidvoidputInteger(String key, int value) voidvoidvoidbooleansave(@NotNull ConfigSource source) Saves the config to the backing source.
- If the source is not writable, this is a NO-OP and returns false.
- If no changes are detected, returns false.
- If writable and changes should be persisted, serialize and write.booleansave(@NotNull ConfigSource source, boolean force) Saves the config to the backing source.
- If the source is not writable, this is a NO-OP and returns false.
- If force is false and no changes are detected, returns false.
- If writable and changes should be persisted, serialize and write.voidsetBoolean(String key, boolean value) voidvoidvoidvoidvoidsetInteger(String key, int value) voidvoidvoidMethods inherited from class com.kamikazejam.kamicommon.yaml.AbstractMemorySection
contains, getKeyNode, getKeys, getNode, getNodeTuple, getNodeValue, getObject, internalPut, isPrimitiveWrapper, parseBigDecimal, put, set, setChanged
-
Constructor Details
-
MemorySectionMethods
public MemorySectionMethods(@Nullable @Nullable org.yaml.snakeyaml.nodes.MappingNode node, @Nullable @Nullable ConfigurationMethods<?> parent)
-
-
Method Details
-
get
-
get
-
putString
-
setString
-
putBoolean
-
setBoolean
-
putInteger
-
putInt
-
setInteger
-
setInt
-
putLong
-
setLong
-
putDouble
-
setDouble
-
putFloat
-
setFloat
-
putByte
-
setByte
-
putShort
-
setShort
-
getString
-
getString
-
isString
-
getBoolean
-
getBoolean
-
isBoolean
-
getByte
-
getByte
-
isByte
-
getShort
-
getShort
-
isShort
-
getInt
-
getInt
-
isInt
-
getLong
-
getLong
-
isLong
-
getFloat
-
getFloat
-
isFloat
-
getDouble
-
getDouble
-
isDouble
-
getBigDecimal
-
getBigDecimal
-
isNumber
-
getList
-
getList
-
isList
-
getStringList
-
getStringList
-
getIntegerList
-
getIntegerList
-
getByteList
-
getByteList
-
getKeys
Returns the keys of the config If Deep is enabled, it will dig and find all valid keys that resolve to a value- Parameters:
deep- Whether to search for all sub-keys- Returns:
- The list of keys found
-
isConfigurationSection
-
contains
-
isSet
-
addDefault
-
isEmpty
public boolean isEmpty() -
save
Saves the config to the backing source.
- If the source is not writable, this is a NO-OP and returns false.
- If no changes are detected, returns false.
- If writable and changes should be persisted, serialize and write.- Parameters:
source- The destination/source abstraction- Returns:
- true IFF the config was saved successfully (may be skipped if not changed)
-
save
Saves the config to the backing source.
- If the source is not writable, this is a NO-OP and returns false.
- If force is false and no changes are detected, returns false.
- If writable and changes should be persisted, serialize and write.- Parameters:
source- The destination/source abstractionforce- If the config should be saved even if no changes were made- Returns:
- true IFF the config was saved successfully (may be skipped if not changed and force is false)
-