Class StringConverter
java.lang.Object
ru.vyarus.dropwizard.guice.module.context.option.mapper.StringConverter
Simple converter from string source to target type. Supports:
- String
- Boolean
- Integer
- Double
- Short
- Byte
- Enum type value (when target type is exact enum type and string is enum constant)
- Enum recognition (when target type is generic Enum and string is "fullEnumClass.constantName"
Special support for EnumSet: it must be a list of fully qualified enum values (enumClass.enumValue).
- Since:
- 27.04.2018
-
Method Summary
-
Method Details
-
convert
Convert string to type.- Type Parameters:
V- targe type- Parameters:
target- target typevalue- value to convert- Returns:
- converted value
-