Record Class DateGroupItem

java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.DateGroupItem

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. Fields beyond the grouping precision are null.

Use the static factories: year(int), month(int, int), day(int, int, int), hour, minute, second.

  • 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)
    Select a single day.
    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)
    Select a single hour of a day (0-23).
    Returns the value of the minute record component.
    minute(int year, int month, int day, int hour, int minute)
    Select a single minute.
    Returns the value of the month record component.
    month(int year, int month)
    Select a whole month (month is 1-based).
    Returns the value of the second record component.
    second(int year, int month, int day, int hour, int minute, int second)
    Select a single second.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the year record component.
    year(int year)
    Select 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)
      Select the whole calendar year.
    • month

      public static DateGroupItem month(int year, int month)
      Select a whole month (month is 1-based).
    • day

      public static DateGroupItem day(int year, int month, int day)
      Select a single day.
    • hour

      public static DateGroupItem hour(int year, int month, int day, int hour)
      Select a single hour of a day (0-23).
    • minute

      public static DateGroupItem minute(int year, int month, int day, int hour, int minute)
      Select a single minute.
    • second

      public static DateGroupItem second(int year, int month, int day, int hour, int minute, int second)
      Select a single second.
    • 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