Class InstantConverter

java.lang.Object
org.apache.commons.beanutils.converters.AbstractConverter
dev.orne.beans.converters.AbstractDateTimeConverter
dev.orne.beans.converters.InstantConverter
All Implemented Interfaces:
org.apache.commons.beanutils.Converter

@API(status=STABLE, since="0.1") public class InstantConverter extends AbstractDateTimeConverter
Implementation of Converter that converts Instant instances to and from String using the ISO-8601 as String representation.
Since:
0.1
Version:
1.0, 2020-05
Author:
(w) Iker Hernaez
  • Field Details

    • EPOCH_MILLIS_PARSER

      public static final DateTimeFormatter EPOCH_MILLIS_PARSER
      The epoch milliseconds parser.
  • Constructor Details

    • InstantConverter

      public InstantConverter()
      Creates a new instance that throws a ConversionException if an error occurs.
    • InstantConverter

      public InstantConverter(@Nullable Instant defaultValue)
      Creates a new instance that returns a default value if an error occurs.
      Parameters:
      defaultValue - The default value to be returned if the value to be converted is missing or an error occurs converting the value
    • InstantConverter

      public InstantConverter(DateTimeFormatter formatter)
      Creates a new instance that throws a ConversionException if an error occurs.
      Parameters:
      formatter - The temporal value formatter and default parser
    • InstantConverter

      public InstantConverter(DateTimeFormatter formatter, @Nullable Instant defaultValue)
      Creates a new instance that returns a default value if an error occurs.
      Parameters:
      formatter - The temporal value formatter and default parser
      defaultValue - The default value to be returned if the value to be converted is missing or an error occurs converting the value
  • Method Details