public class ConvertedFileConfig extends ConfigWrapper<C> implements FileConfig
Config.Entryconfig| Constructor and Description |
|---|
ConvertedFileConfig(FileConfig config,
ConversionTable readTable,
ConversionTable writeTable,
java.util.function.Predicate<java.lang.Class<?>> supportPredicate) |
ConvertedFileConfig(FileConfig config,
java.util.function.Function<java.lang.Object,java.lang.Object> readConversion,
java.util.function.Function<java.lang.Object,java.lang.Object> writeConversion,
java.util.function.Predicate<java.lang.Class<?>> supportPredicate) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this FileConfig, releases its associated resources (if any), and ensure that the
ongoing saving operations complete.
|
ConfigFormat<?> |
configFormat()
Returns the config's format.
|
java.io.File |
getFile() |
java.nio.file.Path |
getNioPath() |
<T> T |
getRaw(java.util.List<java.lang.String> path)
Gets a value from the config.
|
void |
load()
(Re)loads this config from the file.
|
void |
save()
Saves this config as soon as possible.
|
<T> T |
set(java.util.List<java.lang.String> path,
java.lang.Object value)
Sets a config value.
|
java.lang.String |
toString() |
java.util.Map<java.lang.String,java.lang.Object> |
valueMap()
Returns a Map view of the config's values.
|
add, clear, createSubConfig, entrySet, removecontains, equals, hashCode, isEmpty, sizeclone, finalize, getClass, notify, notifyAll, wait, wait, waitbuilder, builder, builder, builder, builder, builder, checked, of, of, of, of, of, of, ofConcurrent, ofConcurrent, ofConcurrent, ofConcurrent, ofConcurrent, ofConcurrentadd, add, addAll, clear, concurrentCopy, concurrentCopy, copy, copy, copy, copy, createSubConfig, entrySet, getDefaultMapCreator, getDefaultMapCreator, inMemory, inMemoryConcurrent, inMemoryUniversal, inMemoryUniversalConcurrent, isInsertionOrderPreserved, of, of, ofConcurrent, putAll, remove, remove, removeAll, set, set, setInsertionOrderPreserved, unmodifiable, update, update, valueMap, wrapapply, apply, configFormat, contains, contains, get, get, getByte, getByte, getByteOrElse, getByteOrElse, getChar, getChar, getCharOrElse, getCharOrElse, getEnum, getEnum, getEnum, getEnum, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getEnumOrElse, getInt, getInt, getIntOrElse, getIntOrElse, getIntOrElse, getIntOrElse, getLong, getLong, getLongOrElse, getLongOrElse, getLongOrElse, getLongOrElse, getOptional, getOptional, getOptionalEnum, getOptionalEnum, getOptionalEnum, getOptionalEnum, getOptionalInt, getOptionalInt, getOptionalLong, getOptionalLong, getOrElse, getOrElse, getOrElse, getOrElse, getRaw, getRaw, getShort, getShort, getShortOrElse, getShortOrElse, isEmpty, isNull, isNull, sizepublic ConvertedFileConfig(FileConfig config, ConversionTable readTable, ConversionTable writeTable, java.util.function.Predicate<java.lang.Class<?>> supportPredicate)
public ConvertedFileConfig(FileConfig config, java.util.function.Function<java.lang.Object,java.lang.Object> readConversion, java.util.function.Function<java.lang.Object,java.lang.Object> writeConversion, java.util.function.Predicate<java.lang.Class<?>> supportPredicate)
public java.io.File getFile()
getFile in interface FileConfigpublic java.nio.file.Path getNioPath()
getNioPath in interface FileConfigpublic void save()
FileConfigsave in interface FileConfigpublic void load()
FileConfigload in interface FileConfigpublic void close()
FileConfig
A closed FileConfig can still be used via the Config's methods, but FileConfig.save() and
FileConfig.load() will throw an IllegalStateException. Closing an aleady closed FileConfig has
no effect.
close in interface FileConfigclose in interface java.lang.AutoCloseablepublic <T> T set(java.util.List<java.lang.String> path,
java.lang.Object value)
Configset in interface Configset in class ConfigWrapper<C extends Config>T - the type of the old valuepath - the value's path, each element of the list is a different part of the path.value - the value to setnullpublic java.util.Map<java.lang.String,java.lang.Object> valueMap()
UnmodifiableConfigvalueMap in interface ConfigvalueMap in interface UnmodifiableConfigvalueMap in class UnmodifiableConfigWrapper<C extends Config>public <T> T getRaw(java.util.List<java.lang.String> path)
UnmodifiableConfigNullObject.NULL_OBJECT to null.getRaw in interface UnmodifiableConfiggetRaw in class UnmodifiableConfigWrapper<C extends Config>T - the value's typepath - the value's path, each element of the list is a different part of the path.null if there is no such value.public ConfigFormat<?> configFormat()
UnmodifiableConfigconfigFormat in interface UnmodifiableConfigconfigFormat in class UnmodifiableConfigWrapper<C extends Config>public java.lang.String toString()
toString in class ConfigWrapper<C extends Config>