Interface CommentedFileConfig
- All Superinterfaces:
AutoCloseable,CommentedConfig,Config,FileConfig,UnmodifiableCommentedConfig,UnmodifiableConfig
- All Known Implementing Classes:
ConvertedCommentedFileConfig
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.electronwill.nightconfig.core.CommentedConfig
CommentedConfig.EntryNested classes/interfaces inherited from interface com.electronwill.nightconfig.core.Config
Config.EntryNested classes/interfaces inherited from interface com.electronwill.nightconfig.core.UnmodifiableCommentedConfig
UnmodifiableCommentedConfig.CommentNode -
Method Summary
Modifier and TypeMethodDescriptionstatic CommentedFileConfigBuilderReturns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderbuilder(File file, ConfigFormat<? extends CommentedConfig> format) Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderReturns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderbuilder(String filePath, ConfigFormat<? extends CommentedConfig> format) Returns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderReturns a CommentedFileConfigBuilder to create a CommentedFileConfig with many options.static CommentedFileConfigBuilderbuilder(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 CommentedFileConfigCreates a new FileConfig based on the specified file and format.static CommentedFileConfigof(File file, ConfigFormat<? extends CommentedConfig> format) Creates a new FileConfig based on the specified file and format.static CommentedFileConfigCreates a new FileConfig based on the specified file and format.static CommentedFileConfigof(String filePath, ConfigFormat<? extends CommentedConfig> format) Creates a new FileConfig based on the specified file and format.static CommentedFileConfigCreates a new FileConfig based on the specified file and format.static CommentedFileConfigof(Path file, ConfigFormat<? extends CommentedConfig> format) Creates a new FileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(File file) Creates a new thread-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(File file, ConfigFormat<? extends CommentedConfig> format) Creates a new trhead-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(String filePath) Creates a new trhead-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(String filePath, ConfigFormat<? extends CommentedConfig> format) Creates a new trhead-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(Path file) Creates a new thread-safe CommentedFileConfig based on the specified file and format.static CommentedFileConfigofConcurrent(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, unmodifiableMethods inherited from interface com.electronwill.nightconfig.core.Config
add, add, addAll, clear, entrySet, putAll, remove, remove, removeAll, set, set, update, update, valueMapMethods inherited from interface com.electronwill.nightconfig.core.file.FileConfig
close, getFile, getNioPath, load, saveMethods inherited from interface com.electronwill.nightconfig.core.UnmodifiableCommentedConfig
containsComment, containsComment, getComment, getComment, getComments, getComments, getOptionalComment, getOptionalCommentMethods 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 Details
-
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
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
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
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
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
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
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
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
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
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
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(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
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(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
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(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
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
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(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
-