Record Class AggregatedQueryKey

java.lang.Object
java.lang.Record
com.inductiveautomation.historian.common.model.options.AggregatedQueryKey
Record Components:
source - the path of the data point
aggregate - the aggregate's identity and parameters
fillMode - what a window the calculation left without a value gets; see FillMode
interpolation - how this key reads the signal and whether its windows take edge values; null or Interpolation.AUTO takes the query's default AggregatedQueryOptions.getInterpolation()
fillValue - the value every empty window takes under FillMode.CONSTANT; ignored under any other fill
All Implemented Interfaces:
DataPointQueryKey, QueryKey<DataPointType>

public record AggregatedQueryKey(QualifiedPath source, AggregateSpec aggregate, FillMode fillMode, @Nullable Interpolation interpolation, @Nullable Double fillValue) extends Record implements DataPointQueryKey
Query key for an aggregated query: a source path, an AggregateSpec, a fill mode, an interpolation and a constant. of(QualifiedPath, AggregationType) builds an unparameterized spec; read aggregate().type() for the underlying AggregationType.
  • Constructor Details

    • AggregatedQueryKey

      public AggregatedQueryKey(QualifiedPath source, AggregateSpec aggregate, FillMode fillMode)
      A key under the query's interpolation with no constant.
    • AggregatedQueryKey

      public AggregatedQueryKey(QualifiedPath source, AggregateSpec aggregate, FillMode fillMode, @Nullable Interpolation interpolation, @Nullable Double fillValue)
      Creates an instance of a AggregatedQueryKey record class.
      Parameters:
      source - the value for the source record component
      aggregate - the value for the aggregate record component
      fillMode - the value for the fillMode record component
      interpolation - the value for the interpolation record component
      fillValue - the value for the fillValue record component
  • Method Details

    • withFillMode

      public AggregatedQueryKey withFillMode(FillMode fillMode)
      Returns this key with fillMode, everything else unchanged.
    • withInterpolation

      public AggregatedQueryKey withInterpolation(@Nullable Interpolation interpolation)
      Returns this key with interpolation, everything else unchanged.
    • pointType

      public DataPointType pointType()
      Specified by:
      pointType in interface QueryKey<DataPointType>
      Returns:
      the point type.
    • of

      public static AggregatedQueryKey of(QualifiedPath source, AggregationType aggregationType)
      Creates a key for an unparameterized aggregate with FillMode.AUTO.
      Parameters:
      source - the path of the data point
      aggregationType - the aggregate
      Returns:
      the key
    • of

      public static AggregatedQueryKey of(QualifiedPath source, AggregationType aggregationType, FillMode fillMode)
      Creates a key for an unparameterized aggregate with the given fill mode.
      Parameters:
      source - the path of the data point
      aggregationType - the aggregate
      fillMode - what a window with no samples gets
      Returns:
      the key
    • of

      public static AggregatedQueryKey of(QualifiedPath source, AggregateSpec aggregate)
      Creates a key for a possibly parameterized aggregate with FillMode.AUTO.
      Parameters:
      source - the path of the data point
      aggregate - the aggregate's identity and parameters
      Returns:
      the key
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • source

      public QualifiedPath source()
      Returns the value of the source record component.
      Specified by:
      source in interface DataPointQueryKey
      Returns:
      the value of the source record component
    • aggregate

      public AggregateSpec aggregate()
      Returns the value of the aggregate record component.
      Returns:
      the value of the aggregate record component
    • fillMode

      public FillMode fillMode()
      Returns the value of the fillMode record component.
      Returns:
      the value of the fillMode record component
    • interpolation

      public @Nullable Interpolation interpolation()
      Returns the value of the interpolation record component.
      Returns:
      the value of the interpolation record component
    • fillValue

      public @Nullable Double fillValue()
      Returns the value of the fillValue record component.
      Returns:
      the value of the fillValue record component