Interface ConfigValueParser<T>

Type Parameters:
T - Type of the object being parsed.
All Known Implementing Classes:
ConfigValueParser.BooleanParser, ConfigValueParser.IntegerParser, ConfigValueParser.LongParser, ConfigValueParser.StringListParser, ConfigValueParser.StringParser

public interface ConfigValueParser<T>
Utilities for parsing config values.
  • Method Details

    • getParserFor

      static ConfigValueParser getParserFor(Class type)
    • toStringParser

      static ConfigValueParser toStringParser()
    • compose

      T compose(String fromValue)
      Parse a String value in the config into the appropriate object.
      Parameters:
      fromValue - String value in the config.
      Returns:
      Config value or null if it could not be parsed.
    • decompose

      String decompose(T ofValue)
      Parse an object into a String value to save in the config.
      Parameters:
      ofValue - Value to save, not null.
      Returns:
      String format to save in the config.
      Throws:
      IllegalArgumentException - If null value is given.
    • nullInvalidException

      static IllegalArgumentException nullInvalidException()