Class DateResolvers.PartLenient

  • All Implemented Interfaces:
    java.io.Serializable, DateResolver
    Enclosing class:
    DateResolvers

    private static class DateResolvers.PartLenient
    extends java.lang.Object
    implements DateResolver, java.io.Serializable
    Class implementing partLenient resolver.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static DateResolver INSTANCE
      The singleton instance.
      private static long serialVersionUID
      A serialization identifier for this class.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PartLenient()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.Object readResolve()  
      LocalDate resolveDate​(int year, MonthOfYear monthOfYear, int dayOfMonth)
      Resolves the combination of year, month and day into a date.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        A serialization identifier for this class.
        See Also:
        Constant Field Values
      • INSTANCE

        private static final DateResolver INSTANCE
        The singleton instance.
    • Constructor Detail

      • PartLenient

        private PartLenient()
    • Method Detail

      • readResolve

        private java.lang.Object readResolve()
      • resolveDate

        public LocalDate resolveDate​(int year,
                                     MonthOfYear monthOfYear,
                                     int dayOfMonth)
        Resolves the combination of year, month and day into a date.

        The purpose of resolution is to avoid invalid dates. Each of the three fields are individually valid. However, the day-of-month may not be valid for the associated month and year.

        Specified by:
        resolveDate in interface DateResolver
        Parameters:
        year - the year that was input, from MIN_YEAR to MAX_YEAR
        monthOfYear - the month-of-year, not null
        dayOfMonth - the proposed day-of-month, from 1 to 31
        Returns:
        the resolved date, never null