Class DateRange

java.lang.Object
com.jbstrap.ui.components.form.base.DateRange

public class DateRange extends Object
Class representing a Date range
Since:
4.0
Author:
JBStrap
  • Field Details

    • MIN_DATE_VALUE

      public static final Date MIN_DATE_VALUE
    • MAX_DATE_VALUE

      public static final Date MAX_DATE_VALUE
  • Constructor Details

    • DateRange

      public DateRange()
      Creates a date range object. This date range will have the minimum/maximum date as its minimum/maximum value.
    • DateRange

      public DateRange(Date startDate, Date endDate)
      Creates a date range, with the specified minimum and maximum dates.
      Parameters:
      startDate - The starting (minimum) date of the range. If null, the minimum range value will be the minimum Date value
      endDate - The ending (maximum) date of the range. If null, the maximum range value will be the maximum Date value
      Throws:
      IllegalArgumentException - If the minimum date is greater than the maximum date
  • Method Details

    • getStartDate

      public Date getStartDate()
      Gets the start date of the date range
      Returns:
      The minimum range value (start date)
    • getEndDate

      public Date getEndDate()
      Gets the end date of the date range
      Returns:
      The maximum range value (end date)
    • setStartDate

      public DateRange setStartDate(Date date)
      Sets the start date of the date range
      Parameters:
      date - The starting (minimum) date of the range. If null, the minimum range value will be the minimum Date value
      Returns:
      The range
      Throws:
      IllegalArgumentException - If the minimum date is greater than the maximum date
    • setEndDate

      public DateRange setEndDate(Date date)
      Sets the end date of the date range
      Parameters:
      date - The ending (maximum) date of the range. If null, the maximum range value will be the maximum Date value
      Returns:
      The range
      Throws:
      IllegalArgumentException - If the minimum date is greater than the maximum date
    • setRange

      public DateRange setRange(Date startDate, Date endDate)
      Sets the date range
      Parameters:
      startDate - The starting (minimum) date of the range. If null, the minimum range value will be the minimum Date value
      endDate - The ending (maximum) date of the range. If null, the maximum range value will be the maximum Date value
      Returns:
      The range
      Throws:
      IllegalArgumentException - If the minimum date is greater than the maximum date
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object