Enum TimeUnitRange

java.lang.Object
java.lang.Enum<TimeUnitRange>
org.apache.calcite.avatica.util.TimeUnitRange
All Implemented Interfaces:
Serializable, Comparable<TimeUnitRange>, java.lang.constant.Constable

public enum TimeUnitRange extends Enum<TimeUnitRange>
A range of time units. The first is more significant than the other (e.g. year-to-day) or the same as the other (e.g. month).
  • Enum Constant Details

  • Field Details

    • startUnit

      public final TimeUnit startUnit
    • endUnit

      public final TimeUnit endUnit
  • Method Details

    • values

      public static TimeUnitRange[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static TimeUnitRange valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static TimeUnitRange of(TimeUnit startUnit, TimeUnit endUnit)
      Returns a TimeUnitRange with a given start and end unit.
      Parameters:
      startUnit - Start unit
      endUnit - End unit
      Returns:
      Time unit range, or null if not valid
    • monthly

      public boolean monthly()
      Whether this is in the YEAR-TO-MONTH family of intervals.