Class ConvertedFormat<C extends Config,F extends ConfigFormat<C>>
java.lang.Object
com.electronwill.nightconfig.core.conversion.ConvertedFormat<C,F>
- All Implemented Interfaces:
ConfigFormat<C>
public final class ConvertedFormat<C extends Config,F extends ConfigFormat<C>>
extends Object
implements ConfigFormat<C>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a config of this format.createConfig(Supplier<Map<String, Object>> mapCreator) Creates a config that uses the given map supplier for all its levels (top level and subconfigs).booleanChecks if this format supports CommentedConfigs.booleansupportsType(Class<?> type) Checks if this format supports the given type of value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.electronwill.nightconfig.core.ConfigFormat
initEmptyFile, initEmptyFile, initEmptyFile, isInMemory
-
Constructor Details
-
ConvertedFormat
-
-
Method Details
-
createWriter
- Specified by:
createWriterin interfaceConfigFormat<C extends Config>- Returns:
- a writer of this config format
-
createParser
- Specified by:
createParserin interfaceConfigFormat<C extends Config>- Returns:
- a parser of this config format
-
createConfig
- Specified by:
createConfigin interfaceConfigFormat<C extends Config>- Returns:
- a config of this format
-
createConcurrentConfig
Description copied from interface:ConfigFormatCreates a config of this format. The returned config is guaranteed to be thread-safe.- Specified by:
createConcurrentConfigin interfaceConfigFormat<C extends Config>- Returns:
- a concurrent config of this format
-
createConfig
Description copied from interface:ConfigFormatCreates a config that uses the given map supplier for all its levels (top level and subconfigs).- Specified by:
createConfigin interfaceConfigFormat<C extends Config>- Parameters:
mapCreator- the map supplier for the config- Returns:
- a config of this format with the given map creator
-
supportsComments
public boolean supportsComments()Description copied from interface:ConfigFormatChecks if this format supports CommentedConfigs. Note that supporting CommentedConfigs isn't the same things as allowing the user to write comments in the config files.- Specified by:
supportsCommentsin interfaceConfigFormat<C extends Config>- Returns:
trueiff this format supports CommentedConfigs
-
supportsType
Description copied from interface:ConfigFormatChecks if this format supports the given type of value.- Specified by:
supportsTypein interfaceConfigFormat<C extends Config>- Parameters:
type- the type to check, may be null in which case this method checks if the format supports null values- Returns:
trueiff this format supports the given type
-