Class NumberConverter.Comparable<S extends Number>

java.lang.Object
org.apache.sis.internal.converter.ClassPair<S,T>
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 Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
  • Constructor Details

    • Comparable

      Comparable(Class<S> sourceClass)
      Creates a new converter from the given type of numbers to Comparable instances.
  • Method Details

    • properties

      public Set<FunctionProperty> properties()
      If the source class implements Comparable, 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

      public Comparable<?> apply(Number source)
      Converts the given number to a Comparable if its type is different.
      Parameters:
      source - the object to convert, or null.
      Returns:
      the converted object, or null.