public interface FileConfig extends Config, java.lang.AutoCloseable
Config.Entry| Modifier and Type | Method and Description |
|---|---|
static FileConfigBuilder |
builder(java.io.File file)
Returns a FileConfigBuilder to create a FileConfig with many options.
|
static FileConfigBuilder |
builder(java.io.File file,
ConfigFormat<?> format)
Returns a FileConfigBuilder to create a FileConfig with many options.
|
static FileConfigBuilder |
builder(java.nio.file.Path file)
Returns a FileConfigBuilder to create a FileConfig with many options.
|
static FileConfigBuilder |
builder(java.nio.file.Path file,
ConfigFormat<?> format)
Returns a FileConfigBuilder to create a FileConfig with many options.
|
static FileConfigBuilder |
builder(java.lang.String filePath)
Returns a FileConfigBuilder to create a FileConfig with many options.
|
static FileConfigBuilder |
builder(java.lang.String filePath,
ConfigFormat<?> format)
Returns a FileConfigBuilder to create a FileConfig with many options.
|
default FileConfig |
checked()
Returns a checked view of the config.
|
void |
close()
Closes this FileConfig, releases its associated resources (if any), and ensure that the
ongoing saving operations complete.
|
java.io.File |
getFile() |
java.nio.file.Path |
getNioPath() |
void |
load()
(Re)loads this config from the file.
|
static FileConfig |
of(java.io.File file)
Creates a new FileConfig based on the specified file.
|
static FileConfig |
of(java.io.File file,
ConfigFormat<? extends Config> format)
Creates a new FileConfig based on the specified file and format.
|
static FileConfig |
of(java.nio.file.Path file)
Creates a new FileConfig based on the specified file.
|
static FileConfig |
of(java.nio.file.Path file,
ConfigFormat<? extends Config> format)
Creates a new FileConfig based on the specified file and format.
|
static FileConfig |
of(java.lang.String filePath)
Creates a new FileConfig based on the specified file.
|
static FileConfig |
of(java.lang.String filePath,
ConfigFormat<?> format)
Creates a new FileConfig based on the specified file and format.
|
static FileConfig |
ofConcurrent(java.io.File file)
Creates a new thread-safe FileConfig based on the specified file.
|
static FileConfig |
ofConcurrent(java.io.File file,
ConfigFormat<?> format)
Creates a new thread-safe FileConfig based on the specified file and format.
|
static FileConfig |
ofConcurrent(java.nio.file.Path file)
Creates a new thread-safe FileConfig based on the specified file.
|
static FileConfig |
ofConcurrent(java.nio.file.Path file,
ConfigFormat<?> format)
Creates a new thread-safe FileConfig based on the specified file and format.
|
static FileConfig |
ofConcurrent(java.lang.String filePath)
Creates a new thread-safe FileConfig based on the specified file.
|
static FileConfig |
ofConcurrent(java.lang.String filePath,
ConfigFormat<?> format)
Creates a new thread-safe FileConfig based on the specified file and format.
|
void |
save()
Saves this config as soon as possible.
|
add, 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, sizejava.io.File getFile()
java.nio.file.Path getNioPath()
void save()
void load()
void close()
A closed FileConfig can still be used via the Config's methods, but save() and
load() will throw an IllegalStateException. Closing an aleady closed FileConfig has
no effect.
close in interface java.lang.AutoCloseabledefault FileConfig checked()
ConfigConfigFormat.supportsType(Class)
method. Trying to insert an unsupported value throws an IllegalArgumentException.
The values that are in the config when this method is called are also checked.
static FileConfig of(java.io.File file)
file - the file to use to save and load the configNoFormatFoundException - if the format detection failsstatic FileConfig of(java.io.File file, ConfigFormat<? extends Config> format)
file - the file to use to save and load the configformat - the config's formatstatic FileConfig of(java.nio.file.Path file)
file - the file to use to save and load the configNoFormatFoundException - if the format detection failsstatic FileConfig of(java.nio.file.Path file, ConfigFormat<? extends Config> format)
file - the file to use to save and load the configformat - the config's formatstatic FileConfig of(java.lang.String filePath)
filePath - the file's pathNoFormatFoundException - if the format detection failsstatic FileConfig of(java.lang.String filePath, ConfigFormat<?> format)
filePath - the file's pathformat - the config's formatstatic FileConfig ofConcurrent(java.io.File file)
file - the file to use to save and load the configNoFormatFoundException - if the format detection failsstatic FileConfig ofConcurrent(java.io.File file, ConfigFormat<?> format)
file - the file to use to save and load the configformat - the config's formatstatic FileConfig ofConcurrent(java.nio.file.Path file)
file - the file to use to save and load the configNoFormatFoundException - if the format detection failsstatic FileConfig ofConcurrent(java.nio.file.Path file, ConfigFormat<?> format)
file - the file to use to save and load the configformat - the config's formatstatic FileConfig ofConcurrent(java.lang.String filePath)
filePath - the file's pathNoFormatFoundException - if the format detection failsstatic FileConfig ofConcurrent(java.lang.String filePath, ConfigFormat<?> format)
filePath - the file's pathformat - the config's formatstatic FileConfigBuilder builder(java.io.File file)
file - the file to use to save and load the configNoFormatFoundException - if the format detection failsstatic FileConfigBuilder builder(java.io.File file, ConfigFormat<?> format)
file - the file to use to save and load the configformat - the config's formatstatic FileConfigBuilder builder(java.nio.file.Path file)
file - the file to use to save and load the configNoFormatFoundException - if the format detection failsstatic FileConfigBuilder builder(java.nio.file.Path file, ConfigFormat<?> format)
file - the file to use to save and load the configformat - the config's formatstatic FileConfigBuilder builder(java.lang.String filePath)
filePath - the file's pathNoFormatFoundException - if the format detection failsstatic FileConfigBuilder builder(java.lang.String filePath, ConfigFormat<?> format)
filePath - the file's pathformat - the config's format