Record Class DateGroupItem

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.DateGroupItem
Record Components:
grouping - the period: "year", "month", "day", "hour", "minute" or "second"; another value makes setColumnDateFilter throw AxyraException
year - the four-digit year; outside 0 to 65535, setColumnDateFilter throws AxyraException
month - the 1-based month (1 to 12), or null for a year item
day - the day of the month (1 to 31), or null beyond the grouping's precision
hour - the hour of the day (0 to 23), or null beyond the grouping's precision
minute - the minute (0 to 59), or null beyond the grouping's precision
second - the second (0 to 59), or null beyond the grouping's precision

public record DateGroupItem(String grouping, int year, Integer month, Integer day, Integer hour, Integer minute, Integer second) extends Record
One date grouping item of a date auto-filter (ECMA-376 §18.3.2.4 dateGroupItem, §18.18.24 ST_DateTimeGrouping): selects every date/time cell inside the period named by grouping. Pass items to Sheet.setColumnDateFilter(int, DateGroupItem...). Fields beyond the grouping's precision are null.

Prefer the static factories year(int), month(int, int), day(int, int, int), hour, minute and second; they set grouping and the null fields correctly. The values are not range-checked here.

  • Constructor Summary

    Constructors
    Constructor
    Description
    DateGroupItem(String grouping, int year, Integer month, Integer day, Integer hour, Integer minute, Integer second)
    Creates an instance of a DateGroupItem record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    day()
    Returns the value of the day record component.
    day(int year, int month, int day)
    An item that selects one day; month is 1-based, day is 1 to 31.
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the grouping record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the hour record component.
    hour(int year, int month, int day, int hour)
    An item that selects one hour of a day; hour is 0 to 23.
    Returns the value of the minute record component.
    minute(int year, int month, int day, int hour, int minute)
    An item that selects one minute; hour is 0 to 23, minute 0 to 59.
    Returns the value of the month record component.
    month(int year, int month)
    An item that selects a whole month; month is 1-based (1 to 12).
    Returns the value of the second record component.
    second(int year, int month, int day, int hour, int minute, int second)
    An item that selects one second; minute and second are 0 to 59.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the year record component.
    year(int year)
    An item that selects the whole calendar year.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DateGroupItem

      public DateGroupItem(String grouping, int year, Integer month, Integer day, Integer hour, Integer minute, Integer second)
      Creates an instance of a DateGroupItem record class.
      Parameters:
      grouping - the value for the grouping record component
      year - the value for the year record component
      month - the value for the month record component
      day - the value for the day record component
      hour - the value for the hour record component
      minute - the value for the minute record component
      second - the value for the second record component
  • Method Details

    • year

      public static DateGroupItem year(int year)
      An item that selects the whole calendar year.
    • month

      public static DateGroupItem month(int year, int month)
      An item that selects a whole month; month is 1-based (1 to 12).
    • day

      public static DateGroupItem day(int year, int month, int day)
      An item that selects one day; month is 1-based, day is 1 to 31.
    • hour

      public static DateGroupItem hour(int year, int month, int day, int hour)
      An item that selects one hour of a day; hour is 0 to 23.
    • minute

      public static DateGroupItem minute(int year, int month, int day, int hour, int minute)
      An item that selects one minute; hour is 0 to 23, minute 0 to 59.
    • second

      public static DateGroupItem second(int year, int month, int day, int hour, int minute, int second)
      An item that selects one second; minute and second are 0 to 59.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • grouping

      public String grouping()
      Returns the value of the grouping record component.
      Returns:
      the value of the grouping record component
    • year

      public int year()
      Returns the value of the year record component.
      Returns:
      the value of the year record component
    • month

      public Integer month()
      Returns the value of the month record component.
      Returns:
      the value of the month record component
    • day

      public Integer day()
      Returns the value of the day record component.
      Returns:
      the value of the day record component
    • hour

      public Integer hour()
      Returns the value of the hour record component.
      Returns:
      the value of the hour record component
    • minute

      public Integer minute()
      Returns the value of the minute record component.
      Returns:
      the value of the minute record component
    • second

      public Integer second()
      Returns the value of the second record component.
      Returns:
      the value of the second record component