Class ConvertedConfig

  • All Implemented Interfaces:
    Config, UnmodifiableConfig

    public final class ConvertedConfig
    extends ConfigWrapper<C>
    A Config's wrapper that converts the values that are read from and put into the config
    • Constructor Detail

      • ConvertedConfig

        public ConvertedConfig​(Config config,
                               ConversionTable readTable,
                               ConversionTable writeTable,
                               java.util.function.Predicate<java.lang.Class<?>> supportPredicate)
        Creates a new ConvertedConfig that uses two conversion tables.
        Parameters:
        config - the config to wrap
        readTable - the ConversionTable used for parse operations (like getValue)
        writeTable - the ConversionTable used for write operations (like setValue)
        supportPredicate - a Predicate that checks if a given class is supported by the ConvertedConfig
      • ConvertedConfig

        public ConvertedConfig​(Config config,
                               java.util.function.Function<java.lang.Object,​java.lang.Object> readConversion,
                               java.util.function.Function<java.lang.Object,​java.lang.Object> writeConversion,
                               java.util.function.Predicate<java.lang.Class<?>> supportPredicate)
        Creates a new ConvertedConfig that uses two custom conversion functions.
        Parameters:
        config - the config to wrap
        readConversion - the Function used for parse operations (like getValue)
        writeConversion - the Function used for write operations (like setValue)
        supportPredicate - a Predicate that checks if a given class is supported by the ConvertedConfig