Enum ChronoUnitEnum

java.lang.Object
java.lang.Enum<ChronoUnitEnum>
org.apache.calcite.util.format.postgresql.ChronoUnitEnum
All Implemented Interfaces:
Serializable, Comparable<ChronoUnitEnum>, Constable

public enum ChronoUnitEnum extends Enum<ChronoUnitEnum>
A component of a datetime. May belong to a type of calendar. Also contains a list of parent values. For example months are in a year. A datetime can be reconstructed from one or more ChronUnitEnum items along with their associated values.

Some ChronoUnitEnum items conflict with others.

  • Enum Constant Details

  • Method Details

    • values

      public static ChronoUnitEnum[] 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 ChronoUnitEnum 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
    • getChronoUnit

      public ChronoUnit getChronoUnit()
      Get the ChronoUnit value that corresponds to this value.
      Returns:
      a ChronoUnit value
    • getCalendars

      public Set<DateCalendarEnum> getCalendars()
      Get the set of calendars that this value can be in.
      Returns:
      set of calendars that this value can be in
    • isCompatible

      public boolean isCompatible(Set<ChronoUnitEnum> units)
      Checks if the current item can be added to units without causing any conflicts.
      Parameters:
      units - a Set of items to test against
      Returns:
      true if this item does not conflict with units