Package org.apache.sis.metadata.iso
Class DefaultMetadata.ToLocale
java.lang.Object
org.apache.sis.internal.converter.SurjectiveConverter<PT_Locale,Locale>
org.apache.sis.metadata.iso.DefaultMetadata.ToLocale
- Enclosing class:
DefaultMetadata
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts the given object from the source type S to the target type T.Returns the type of objects to convert.Returns the type of converted objects.inverse()
Unsupported operation, since surjective converters are non-invertible (unless the converter is bijective, which is decided by subclasses).Methods inherited from class org.apache.sis.internal.converter.SurjectiveConverter
properties, toString
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
ToLocale
private ToLocale()
-
-
Method Details
-
getSourceClass
Description copied from interface:ObjectConverter
Returns the type of objects to convert.- Returns:
- the type of objects to convert.
-
getTargetClass
Description copied from interface:ObjectConverter
Returns the type of converted objects.- Returns:
- the type of converted objects.
-
apply
Description copied from interface:ObjectConverter
Converts the given object from the source type S to the target type T. If the given object cannot be converted, then this method may either returnsnull
or throws an exception, at implementation choice (except for injective functions, which must throw an exception - see the class Javadoc for more discussion about function properties).Example: in Apache SIS implementation, converters fromString
toNumber
distinguish two kinds of unconvertible objects:- Null or empty source string result in a
null
value to be returned. - All other kind of unparsable strings results in an exception to be thrown.
""
value is unconvertible but nevertheless considered as part of the converter domain, and is mapped to "no number". All other unparsable strings are considered outside the converter domain.- Parameters:
p
- the object to convert, ornull
.- Returns:
- the converted object, or
null
.
- Null or empty source string result in a
-
inverse
Description copied from class:SurjectiveConverter
Unsupported operation, since surjective converters are non-invertible (unless the converter is bijective, which is decided by subclasses).- Specified by:
inverse
in interfaceObjectConverter<PT_Locale,
Locale> - Overrides:
inverse
in classSurjectiveConverter<PT_Locale,
Locale> - Returns:
- a converter for converting instances of T back to instances of S.
- See Also:
-