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 Details

    • ConvertedFormat

      public ConvertedFormat(F initialFormat, Predicate<Class<?>> supportPredicate)
  • Method Details

    • createWriter

      public ConfigWriter createWriter()
      Specified by:
      createWriter in interface ConfigFormat<C extends Config>
      Returns:
      a writer of this config format
    • createParser

      public ConfigParser<C> createParser()
      Specified by:
      createParser in interface ConfigFormat<C extends Config>
      Returns:
      a parser of this config format
    • createConfig

      public C createConfig()
      Specified by:
      createConfig in interface ConfigFormat<C extends Config>
      Returns:
      a config of this format
    • createConcurrentConfig

      public C createConcurrentConfig()
      Description copied from interface: ConfigFormat
      Creates a config of this format. The returned config is guaranteed to be thread-safe.
      Specified by:
      createConcurrentConfig in interface ConfigFormat<C extends Config>
      Returns:
      a concurrent config of this format
    • createConfig

      public C createConfig(Supplier<Map<String,Object>> mapCreator)
      Description copied from interface: ConfigFormat
      Creates a config that uses the given map supplier for all its levels (top level and subconfigs).
      Specified by:
      createConfig in interface ConfigFormat<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: ConfigFormat
      Checks 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:
      supportsComments in interface ConfigFormat<C extends Config>
      Returns:
      true iff this format supports CommentedConfigs
    • supportsType

      public boolean supportsType(Class<?> type)
      Description copied from interface: ConfigFormat
      Checks if this format supports the given type of value.
      Specified by:
      supportsType in interface ConfigFormat<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:
      true iff this format supports the given type