Class ObjectToString.CodeList<S extends org.opengis.util.CodeList<S>>
java.lang.Object
org.apache.sis.internal.converter.ClassPair<S,T>
org.apache.sis.internal.converter.SystemConverter<S,String>
org.apache.sis.internal.converter.ObjectToString<S>
org.apache.sis.internal.converter.ObjectToString.CodeList<S>
- All Implemented Interfaces:
Serializable,Function<S,,String> ObjectConverter<S,String>
- Enclosing class:
- ObjectToString<S>
static final class ObjectToString.CodeList<S extends org.opengis.util.CodeList<S>>
extends ObjectToString<S>
Specialized instance for
CodeList.
This class invokes CodeList.name() instead of toString().- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.converter.ObjectToString
ObjectToString.CodeList<S extends org.opengis.util.CodeList<S>>, ObjectToString.Enum<S extends Enum<S>> -
Field Summary
FieldsFields inherited from class org.apache.sis.internal.converter.ClassPair
sourceClass, targetClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the given code list element.Function is bijective, because no duplicated code list name shall exist.Methods inherited from class org.apache.sis.internal.converter.ObjectToString
inverse, uniqueMethods inherited from class org.apache.sis.internal.converter.SystemConverter
bijective, equals, formatErrorMessage, getSourceClass, getTargetClass, readResolveMethods inherited from class org.apache.sis.internal.converter.ClassPair
cast, hashCode, parentSource, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
CodeList
CodeList(Class<S> sourceClass, SystemConverter<String, S> inverse) Creates a new converter from the given type of code list to strings.
-
-
Method Details
-
properties
Function is bijective, because no duplicated code list name shall exist.- Specified by:
propertiesin interfaceObjectConverter<S extends org.opengis.util.CodeList<S>,String> - Overrides:
propertiesin classObjectToString<S extends org.opengis.util.CodeList<S>>- Returns:
- the manners in which source values are mapped to target values. May be an empty set, but never null.
-
apply
Returns the name of the given code list element.- Specified by:
applyin interfaceFunction<S extends org.opengis.util.CodeList<S>,String> - Specified by:
applyin interfaceObjectConverter<S extends org.opengis.util.CodeList<S>,String> - Overrides:
applyin classObjectToString<S extends org.opengis.util.CodeList<S>>- Parameters:
source- the object to convert, ornull.- Returns:
- the converted object, or
null.
-