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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ConfigValueParser.BooleanParser
static class
ConfigValueParser.IntegerParser
static class
ConfigValueParser.LongParser
static class
ConfigValueParser.StringListParser
static class
ConfigValueParser.StringParser
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description T
compose(java.lang.String fromValue)
Parse a String value in the config into the appropriate object.java.lang.String
decompose(T ofValue)
Parse an object into a String value to save in the config.static ConfigValueParser
getParserFor(java.lang.Class type)
static java.lang.IllegalArgumentException
nullInvalidException()
static ConfigValueParser
toStringParser()
-
-
-
Method Detail
-
getParserFor
static ConfigValueParser getParserFor(java.lang.Class type)
-
toStringParser
static ConfigValueParser toStringParser()
-
compose
T compose(java.lang.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
java.lang.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:
java.lang.IllegalArgumentException
- If null value is given.
-
nullInvalidException
static java.lang.IllegalArgumentException nullInvalidException()
-
-