Record Class AggregateDescriptor

java.lang.Object
java.lang.Record
com.inductiveautomation.historian.common.query.AggregateDescriptor

public record AggregateDescriptor(AggregateId id, LocalizedString displayName, @Nullable DataType returnType, Set<DataType> acceptedInputTypes, ParameterSchema parameterSchema, String computedBy, boolean standard, boolean approximate, List<Interpolation> interpolations, Map<Interpolation, Set<FillMode>> applicableFills, Set<FillMode> legacyFills) extends Record
Wire descriptor of one aggregate on one source; one per aggregate id per source.

computedBy names the engine that computes the aggregate, or GATEWAY. standard is true for a platform id (StandardAggregates), which exists on every provider; any other id is offered only where its engine serves. approximate marks an estimate two engines may answer differently.

interpolations lists the interpolations offered, the default first; applicableFills maps each of them to the fills that apply under it. legacyFills are the fills of the classic tag history calculation, empty where the provider does not run it.

returnType is a nullable reference rather than an Optional so the descriptor serializes with Gson.

  • Field Details

    • GATEWAY

      public static final String GATEWAY
      The computedBy of an aggregate the gateway folds from raw rows.
      See Also:
  • Constructor Details

  • Method Details

    • computedByGateway

      public boolean computedByGateway()
      Whether the gateway computes the aggregate.
    • withoutLegacyCompatible

      public AggregateDescriptor withoutLegacyCompatible()
      Returns this descriptor for a provider that does not run the classic tag history calculation: no legacy fills.
    • legacyCompatibleFor

      public AggregateDescriptor legacyCompatibleFor(DataType type)
      Returns this descriptor for type, which only the classic tag history calculation calculates: type is accepted, under Interpolation.NONE with no modern fills, and with the legacy fills only.
    • forInputType

      public AggregateDescriptor forInputType(DataType type)
      Returns this descriptor for a type column: without Interpolation.SLOPED for a Boolean or String, as AggregationType.interpolations(DataType) offers it.
    • withoutFill

      public AggregateDescriptor withoutFill(FillMode fill)
      Returns this descriptor without fill under any interpolation or the legacy route.
    • of

      public static AggregateDescriptor of(AggregationType t, String computedBy)
      Returns the descriptor of t as computedBy (an engine id or GATEWAY) has it.
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • id

      public AggregateId id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • displayName

      public LocalizedString displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • returnType

      public @Nullable DataType returnType()
      Returns the value of the returnType record component.
      Returns:
      the value of the returnType record component
    • acceptedInputTypes

      public Set<DataType> acceptedInputTypes()
      Returns the value of the acceptedInputTypes record component.
      Returns:
      the value of the acceptedInputTypes record component
    • parameterSchema

      public ParameterSchema parameterSchema()
      Returns the value of the parameterSchema record component.
      Returns:
      the value of the parameterSchema record component
    • computedBy

      public String computedBy()
      Returns the value of the computedBy record component.
      Returns:
      the value of the computedBy record component
    • standard

      public boolean standard()
      Returns the value of the standard record component.
      Returns:
      the value of the standard record component
    • approximate

      public boolean approximate()
      Returns the value of the approximate record component.
      Returns:
      the value of the approximate record component
    • interpolations

      public List<Interpolation> interpolations()
      Returns the value of the interpolations record component.
      Returns:
      the value of the interpolations record component
    • applicableFills

      public Map<Interpolation, Set<FillMode>> applicableFills()
      Returns the value of the applicableFills record component.
      Returns:
      the value of the applicableFills record component
    • legacyFills

      public Set<FillMode> legacyFills()
      Returns the value of the legacyFills record component.
      Returns:
      the value of the legacyFills record component