Class StringConverter.Enum<T extends Enum<T>>
java.lang.Object
org.apache.sis.internal.converter.ClassPair<S,T>
org.apache.sis.internal.converter.SystemConverter<String,T>
org.apache.sis.internal.converter.StringConverter<T>
org.apache.sis.internal.converter.StringConverter.Enum<T>
- All Implemented Interfaces:
Serializable,Function<String,,T> ObjectConverter<String,T>
- Enclosing class:
- StringConverter<T>
Converter from
String to Enum.
This converter is particular in that it requires the target class in argument
to the constructor.
Instances of this class are created by
SystemRegistry.createConverter(Class, Class).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.converter.StringConverter
StringConverter.Angle, StringConverter.BigDecimal, StringConverter.BigInteger, StringConverter.Boolean, StringConverter.Byte, StringConverter.Charset, StringConverter.CodeList<T extends org.opengis.util.CodeList<T>>, StringConverter.Double, StringConverter.Enum<T extends Enum<T>>, StringConverter.File, StringConverter.Float, StringConverter.Integer, StringConverter.InternationalString, StringConverter.Locale, StringConverter.Long, StringConverter.Number, StringConverter.Path, StringConverter.Short, StringConverter.Unit, StringConverter.URI, StringConverter.URL -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFor cross-version compatibility on serialization.Fields inherited from class org.apache.sis.internal.converter.ClassPair
sourceClass, targetClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) ObjectConverter<T,String> Invoked by the constructor for creating the inverse converter.(package private) TConverts the given string to the target type of this converter.Methods inherited from class org.apache.sis.internal.converter.StringConverter
apply, inverse, propertiesMethods inherited from class org.apache.sis.internal.converter.SystemConverter
bijective, equals, formatErrorMessage, getSourceClass, getTargetClass, readResolve, uniqueMethods inherited from class org.apache.sis.internal.converter.ClassPair
cast, hashCode, parentSource, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility on serialization.- See Also:
-
-
Constructor Details
-
Enum
Creates a new converter for the given enumeration.
-
-
Method Details
-
doConvert
Converts the given string to the target type of this converter.- Specified by:
doConvertin classStringConverter<T extends Enum<T>>- Parameters:
source- the string to convert, guaranteed to be non-null and non-empty.- Returns:
- the converted value.
-
createInverse
ObjectConverter<T,String> createInverse()Invoked by the constructor for creating the inverse converter.- Overrides:
createInversein classStringConverter<T extends Enum<T>>
-