Class DateConverter.Long

All Implemented Interfaces:
Serializable, Function<Date,Long>, ObjectConverter<Date,Long>
Enclosing class:
DateConverter<T>

public static final class DateConverter.Long extends DateConverter<Long>
Converter from Date to Long.
See Also:
  • Field Details

  • Constructor Details

    • Long

      public Long()
  • Method Details

    • properties

      public Set<FunctionProperty> properties()
      Description copied from class: DateConverter
      Returns the function properties.
      Specified by:
      properties in interface ObjectConverter<Date,Long>
      Overrides:
      properties in class DateConverter<Long>
      Returns:
      the manners in which source values are mapped to target values. May be an empty set, but never null.
    • apply

      public Long apply(Date source)
      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 returns null 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 from String to Number 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.
      In other words, the "" 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:
      source - the object to convert, or null.
      Returns:
      the converted object, or null.