Interface CommentedFileConfig
-
- All Superinterfaces:
java.lang.AutoCloseable,CommentedConfig,Config,FileConfig,UnmodifiableCommentedConfig,UnmodifiableConfig
- All Known Implementing Classes:
ConvertedCommentedFileConfig
public interface CommentedFileConfig extends CommentedConfig, FileConfig
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.CommentedConfig
CommentedConfig.Entry
-
Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.Config
Config.Entry
-
Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.UnmodifiableCommentedConfig
UnmodifiableCommentedConfig.CommentNode
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static CommentedFileConfigBuilderbuilder(java.io.File file)Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderbuilder(java.io.File file, ConfigFormat<? extends CommentedConfig> format)Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderbuilder(java.lang.String filePath)Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderbuilder(java.lang.String filePath, ConfigFormat<? extends CommentedConfig> format)Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderbuilder(java.nio.file.Path file)Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderbuilder(java.nio.file.Path file, ConfigFormat<? extends CommentedConfig> format)Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.default CommentedFileConfigchecked()Returns a checked view of the config.static CommentedFileConfigof(java.io.File file)Creates a new FileConfig based on the specified file and format.static CommentedFileConfigof(java.io.File file, ConfigFormat<? extends CommentedConfig> format)Creates a new FileConfig based on the specified file and format.static CommentedFileConfigof(java.lang.String filePath)Creates a new FileConfig based on the specified file and format.static CommentedFileConfigof(java.lang.String filePath, ConfigFormat<? extends CommentedConfig> format)Creates a new FileConfig based on the specified file and format.static CommentedFileConfigof(java.nio.file.Path file)Creates a new FileConfig based on the specified file and format.static CommentedFileConfigof(java.nio.file.Path file, ConfigFormat<? extends CommentedConfig> format)Creates a new FileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(java.io.File file)Creates a new thread-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(java.io.File file, ConfigFormat<? extends CommentedConfig> format)Creates a new trhead-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(java.lang.String filePath)Creates a new trhead-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(java.lang.String filePath, ConfigFormat<? extends CommentedConfig> format)Creates a new trhead-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(java.nio.file.Path file)Creates a new thread-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(java.nio.file.Path file, ConfigFormat<? extends CommentedConfig> format)Creates a new trhead-safe CommentedFileConfig based on the specified file and format.-
Methods inherited from interface com.electronwill.nightconfig.core.CommentedConfig
clearComments, commentMap, createSubConfig, entrySet, putAllComments, putAllComments, removeComment, removeComment, setComment, setComment, unmodifiable
-
Methods inherited from interface com.electronwill.nightconfig.core.Config
add, add, addAll, clear, entrySet, putAll, remove, remove, removeAll, set, set, update, update, valueMap
-
Methods inherited from interface com.electronwill.nightconfig.core.file.FileConfig
close, getFile, getNioPath, load, save
-
Methods inherited from interface com.electronwill.nightconfig.core.UnmodifiableCommentedConfig
containsComment, containsComment, getComment, getComment, getComments, getComments, getOptionalComment, getOptionalComment
-
Methods inherited from interface com.electronwill.nightconfig.core.UnmodifiableConfig
apply, 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, size
-
-
-
-
Method Detail
-
checked
default CommentedFileConfig checked()
Description copied from interface:ConfigReturns a checked view of the config. It checks that all the values put into the config are supported by the config's format (as per theConfigFormat.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.
- Specified by:
checkedin interfaceCommentedConfig- Specified by:
checkedin interfaceConfig- Specified by:
checkedin interfaceFileConfig- Returns:
- a checked view of the config.
-
of
static CommentedFileConfig of(java.io.File file)
Creates a new FileConfig based on the specified file and format. The format is detected automatically.- Parameters:
file- the file to use to save and load the config- Returns:
- a new FileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
of
static CommentedFileConfig of(java.io.File file, ConfigFormat<? extends CommentedConfig> format)
Creates a new FileConfig based on the specified file and format.- Parameters:
file- the file to use to save and load the configformat- the config's format- Returns:
- a new FileConfig associated to the specified file
-
of
static CommentedFileConfig of(java.nio.file.Path file)
Creates a new FileConfig based on the specified file and format. The format is detected automatically.- Parameters:
file- the file to use to save and load the config- Returns:
- a new FileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
of
static CommentedFileConfig of(java.nio.file.Path file, ConfigFormat<? extends CommentedConfig> format)
Creates a new FileConfig based on the specified file and format.- Parameters:
file- the file to use to save and load the configformat- the config's format- Returns:
- a new FileConfig associated to the specified file
-
of
static CommentedFileConfig of(java.lang.String filePath)
Creates a new FileConfig based on the specified file and format. The format is detected automatically.- Parameters:
filePath- the file's path- Returns:
- a new FileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
of
static CommentedFileConfig of(java.lang.String filePath, ConfigFormat<? extends CommentedConfig> format)
Creates a new FileConfig based on the specified file and format.- Parameters:
filePath- the file's pathformat- the config's format- Returns:
- a new FileConfig associated to the specified file
-
ofConcurrent
static CommentedFileConfig ofConcurrent(java.io.File file)
Creates a new thread-safe CommentedFileConfig based on the specified file and format. The format is detected automatically.- Parameters:
file- the file to use to save and load the config- Returns:
- a new thread-safe CommentedFileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
ofConcurrent
static CommentedFileConfig ofConcurrent(java.io.File file, ConfigFormat<? extends CommentedConfig> format)
Creates a new trhead-safe CommentedFileConfig based on the specified file and format.- Parameters:
file- the file to use to save and load the configformat- the config's format- Returns:
- a new thread-safe CommentedFileConfig associated to the specified file
-
ofConcurrent
static CommentedFileConfig ofConcurrent(java.nio.file.Path file)
Creates a new thread-safe CommentedFileConfig based on the specified file and format. The format is detected automatically.- Parameters:
file- the file to use to save and load the config- Returns:
- a new thread-safe CommentedFileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
ofConcurrent
static CommentedFileConfig ofConcurrent(java.nio.file.Path file, ConfigFormat<? extends CommentedConfig> format)
Creates a new trhead-safe CommentedFileConfig based on the specified file and format.- Parameters:
file- the file to use to save and load the configformat- the config's format- Returns:
- a new thread-safe CommentedFileConfig associated to the specified file
-
ofConcurrent
static CommentedFileConfig ofConcurrent(java.lang.String filePath, ConfigFormat<? extends CommentedConfig> format)
Creates a new trhead-safe CommentedFileConfig based on the specified file and format.- Parameters:
filePath- the file's pathformat- the config's format- Returns:
- a new thread-safe CommentedFileConfig associated to the specified file
-
ofConcurrent
static CommentedFileConfig ofConcurrent(java.lang.String filePath)
Creates a new trhead-safe CommentedFileConfig based on the specified file and format. The format is detected automatically.- Parameters:
filePath- the file's path- Returns:
- a new thread-safe CommentedFileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
builder
static CommentedFileConfigBuilder builder(java.io.File file, ConfigFormat<? extends CommentedConfig> format)
Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.- Parameters:
file- the file to use to save and load the configformat- the config's format- Returns:
- a new FileConfigBuilder that will build a CommentedFileConfig associated to the specified file
-
builder
static CommentedFileConfigBuilder builder(java.io.File file)
Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options. The format is detected automatically.- Parameters:
file- the file to use to save and load the config- Returns:
- a new FileConfigBuilder that will build a CommentedFileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
builder
static CommentedFileConfigBuilder builder(java.nio.file.Path file, ConfigFormat<? extends CommentedConfig> format)
Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.- Parameters:
file- the file to use to save and load the configformat- the config's format- Returns:
- a new FileConfigBuilder that will build a CommentedFileConfig associated to the specified file
-
builder
static CommentedFileConfigBuilder builder(java.nio.file.Path file)
Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options. The format is detected automatically.- Parameters:
file- the file to use to save and load the config- Returns:
- a new FileConfigBuilder that will build a CommentedFileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
builder
static CommentedFileConfigBuilder builder(java.lang.String filePath)
Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options. The format is detected automatically.- Parameters:
filePath- the file's path- Returns:
- a new FileConfigBuilder that will build a CommentedFileConfig associated to the specified file
- Throws:
NoFormatFoundException- if the format detection fails
-
builder
static CommentedFileConfigBuilder builder(java.lang.String filePath, ConfigFormat<? extends CommentedConfig> format)
Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.- Parameters:
filePath- the file's pathformat- the config's format- Returns:
- a new FileConfigBuilder that will build a CommentedFileConfig associated to the specified file
-
-