Class DatePeriod


  • @Embeddable
    public class DatePeriod
    extends Object
    A persistent date period
    • Constructor Detail

      • DatePeriod

        public DatePeriod()
      • DatePeriod

        public DatePeriod​(Date begin,
                          Date end)
      • DatePeriod

        public DatePeriod​(Pair<Date,​Date> pair)
    • Method Detail

      • begginingAt

        public static DatePeriod begginingAt​(Date begin)
        Returns a period beginning on the given date, with no end date
      • between

        public static DatePeriod between​(Date begin,
                                         Date end)
        Returns a period between the given begin and end dates
      • endingAt

        public static DatePeriod endingAt​(Date end)
        Returns a period ending on the given date, with no begin date
      • periodIncluding

        public static DatePeriod periodIncluding​(ITimeInterval interval,
                                                 TimeZone timeZone,
                                                 Date date)
        See Also:
        DateHelper#periodIncluding(ITimeInterval, Date)
      • previousPeriod

        public static DatePeriod previousPeriod​(ITimeInterval interval,
                                                TimeZone timeZone,
                                                Date date)
        See Also:
        DateHelper#previousPeriod(ITimeInterval, Date)
      • getBegin

        public Date getBegin()
      • getEnd

        public Date getEnd()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • includes

        public boolean includes​(Date date)
        Returns whether the given date is included in this period. Null begin / end means unbounded. Both ends are inclusive.
      • isEmpty

        public boolean isEmpty()
      • setBegin

        public void setBegin​(Date begin)
      • setEnd

        public void setEnd​(Date end)