Class ExpandedDate


  • public class ExpandedDate
    extends Object
    A VO class to wrap a date in a known format, allowing clients to consume it however they wish.
    • Constructor Detail

      • ExpandedDate

        public ExpandedDate​(LocalDate in)
        Constructs a new ExpandedDate from the given LocalDate.

        In this case, the formatted date will be in the ISO8601 local date standard of yyyy-MM-dd. The timestamp will be set to local midnight in the system time zone.

        Parameters:
        in - The date to convert
      • ExpandedDate

        public ExpandedDate​(ZonedDateTime date)
        Constructs a new ExpandedDate by converting the given ZonedDateTime to an epoch instant.
        Parameters:
        date - The date to convert
      • ExpandedDate

        public ExpandedDate​(LocalDateTime date)
        Constructs a new ExpandedDate by converting the given LocalDateTime to an epoch instant in the system time zone.
        Parameters:
        date - The local date time
      • ExpandedDate

        public ExpandedDate​(Instant instant)
        Constructs a new ExpandedDate by treating the Instant as a Date with millisecond precision.

        This is technically a loss of precision, as Instant values are more precise than Date values.

        Parameters:
        instant - The instant to convert to an ExpandedDate
      • ExpandedDate

        public ExpandedDate​(Date in)
        Constructs a new ExpandedDate from the given input date
        Parameters:
        in - The input date, not null