Enum Class DateTimeGroupBy

java.lang.Object
java.lang.Enum<DateTimeGroupBy>
com.kingsrook.qqq.backend.core.actions.dashboard.widgets.DateTimeGroupBy
All Implemented Interfaces:
Serializable, Comparable<DateTimeGroupBy>, Constable

public enum DateTimeGroupBy extends Enum<DateTimeGroupBy>
Enum to define various "levels" of group-by for on dashboards that want to group records by, e.g., year, or month, or week, or day, or hour.
  • Enum Constant Details

  • Method Details

    • values

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

      public static DateTimeGroupBy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getSqlExpression

      public String getSqlExpression()
    • getSqlExpression

      public String getSqlExpression(ZoneId targetZoneId)
    • selectFromStartAndEndTimes

      public static DateTimeGroupBy selectFromStartAndEndTimes(Instant start, Instant end)
      get an instance of this enum, based on start invalid input: '&' end instants - look at the # of millis between them, and return the first enum value w/ a millisThreshold under that difference. Default to HOUR.
    • makeSelectedString

      public String makeSelectedString(Instant time)
      Make an Instant into a string that will match what came out of the database's DATE_FORMAT() function
    • makeSelectedString

      public String makeSelectedString(Instant time, ZoneId zoneId)
      Make an Instant into a string that will match what came out of the database's DATE_FORMAT() function
    • makeHumanString

      public String makeHumanString(Instant instant)
      Make a string to show to a user
    • makeHumanString

      public String makeHumanString(Instant instant, ZoneId zoneId)
      Make a string to show to a user
    • roundDown

      public Instant roundDown(Instant instant)
    • roundDown

      public Instant roundDown(Instant instant, ZoneId zoneId)
    • increment

      public Instant increment(Instant instant)
    • increment

      public Instant increment(Instant instant, ZoneId zoneId)
    • sqlDateFormatToSelectedDateTimeFormatter

      public static DateTimeFormatter sqlDateFormatToSelectedDateTimeFormatter(String sqlDateFormat)