Enum Class Aggregation

java.lang.Object
java.lang.Enum<Aggregation>
net.solarnetwork.domain.datum.Aggregation
All Implemented Interfaces:
Serializable, Comparable<Aggregation>, Constable

public enum Aggregation extends Enum<Aggregation>
An aggregation level enumeration.
Since:
2.7
Version:
1.0
  • Enum Constant Details

    • None

      public static final Aggregation None
      No aggregation.
      Since:
      1.6
    • Minute

      public static final Aggregation Minute
      Minute level aggregation.
    • FiveMinute

      public static final Aggregation FiveMinute
      Five minute level aggregation.
    • TenMinute

      public static final Aggregation TenMinute
      Ten minute level aggregation.
    • FifteenMinute

      public static final Aggregation FifteenMinute
      Fifteen minute level aggregation.
    • ThirtyMinute

      public static final Aggregation ThirtyMinute
      Thirty minute level aggregation.
      Since:
      1.5
    • Hour

      public static final Aggregation Hour
      Hour level aggregation.
    • HourOfDay

      public static final Aggregation HourOfDay
      Aggregate by hour of the day, e.g. compare 12-1pm across multiple days.
    • SeasonalHourOfDay

      public static final Aggregation SeasonalHourOfDay
      Aggregate by hour of the day per season.
    • Day

      public static final Aggregation Day
      Day level aggregation.
    • DayOfWeek

      public static final Aggregation DayOfWeek
      Aggregate by day of the week, e.g. compare Mondays against Tuesdays across multiple weeks.
    • SeasonalDayOfWeek

      public static final Aggregation SeasonalDayOfWeek
      Aggregate by day of the week per season.
    • Week

      public static final Aggregation Week
      Week level aggregation.
    • WeekOfYear

      public static final Aggregation WeekOfYear
      Aggregate by week of the year, e.g. compare Week 1's against Week 2's across multiple years.
    • Month

      public static final Aggregation Month
      Month level aggregation.
    • Year

      public static final Aggregation Year
      Year level aggregation.
      Since:
      1.6
    • RunningTotal

      public static final Aggregation RunningTotal
      Aggregate all values into a single total result.
      Since:
      1.4
  • Method Details

    • values

      public static Aggregation[] 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 Aggregation 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
    • compareLevel

      public int compareLevel(Aggregation other)
      Compare the level of this to another.
      Parameters:
      other - the other
      Returns:
      -1 if this level less than other level, 0 if levels are equal, or 1 if this level is greater than other level
    • getLevel

      public Integer getLevel()
      Get the number of seconds the aggregation level represents.

      For aggregation levels higher than Day the number of seconds are approximate, based on the following standardized periods:

      • Week - 7 days
      • Month - 4 weeks (28 days)
      • Year - 365 days
      Returns:
      the aggregation level
    • getKey

      public String getKey()
      Get a key value.
      Returns:
      the key
      Since:
      1.6
    • forKey

      public static Aggregation forKey(String key)
      Get an enum instance for a key value.
      Parameters:
      key - the key value; if null or empty then None will be returned
      Returns:
      the enum
      Throws:
      IllegalArgumentException - if key is not supported
      Since:
      1.6