Class OptionParser
java.lang.Object
ru.vyarus.dropwizard.guice.module.context.option.mapper.OptionParser
Utility class for options recognition from string and value parsing.
- Since:
- 26.04.2018
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionparseValue(T option, String value) Parse option value from string.recognizeOption(String option) Recognize option from string.
-
Method Details
-
recognizeOption
Recognize option from string. Format: "optionType.optionName".- Type Parameters:
T- target option type- Parameters:
option- option name- Returns:
- recognized option enum
-
parseValue
Parse option value from string. Only basic conversions are supported: like string, boolean, integer, double, enum value, enum by class and arrays of these types (seeStringConverter).- Type Parameters:
V- option value typeT- option type- Parameters:
option- option enumvalue- string value- Returns:
- parsed option value
-