Class NumberConverter.Comparable<S extends Number>
java.lang.Object
org.apache.sis.internal.converter.ClassPair<S,Comparable<?>>
org.apache.sis.internal.converter.SystemConverter<S,Comparable<?>>
org.apache.sis.internal.converter.NumberConverter.Comparable<S>
- All Implemented Interfaces:
Serializable
,Function<S,
,Comparable<?>> ObjectConverter<S,
Comparable<?>>
- Enclosing class:
NumberConverter<S extends Number,
T extends Number>
static final class NumberConverter.Comparable<S extends Number>
extends SystemConverter<S,Comparable<?>>
Converter from numbers to comparables. This special case exists because
Number
does not implement Comparable
directly, but all known subclasses do.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.internal.converter.ClassPair
sourceClass, targetClass
-
Constructor Summary
ConstructorsConstructorDescriptionComparable
(Class<S> sourceClass) Creates a new converter from the given type of numbers toComparable
instances. -
Method Summary
Modifier and TypeMethodDescriptionComparable
<?> Converts the given number to aComparable
if its type is different.If the source class implementsComparable
, then this converter is bijective.Methods inherited from class org.apache.sis.internal.converter.SystemConverter
bijective, equals, formatErrorMessage, getSourceClass, getTargetClass, inverse, readResolve, unique
Methods inherited from class org.apache.sis.internal.converter.ClassPair
cast, hashCode, parentSource, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
-
Constructor Details
-
Comparable
Creates a new converter from the given type of numbers toComparable
instances.
-
-
Method Details
-
properties
If the source class implementsComparable
, then this converter is bijective. Otherwise there is no known property for this converter.- Returns:
- the manners in which source values are mapped to target values. May be an empty set, but never null.
-
apply
Converts the given number to aComparable
if its type is different.- Parameters:
source
- the object to convert, ornull
.- Returns:
- the converted object, or
null
.
-