Record Class AggregateSpec
java.lang.Object
java.lang.Record
com.inductiveautomation.historian.common.model.options.AggregateSpec
An aggregate's type and typed parameters. The runtime class of
parameters must match
type.parameterSchema().recordType(); construction fails otherwise.
Use of(AggregationType) for an unparameterized aggregate (parameters are NoParams.INSTANCE) and the canonical constructor with a typed record for a parameterized one.
-
Constructor Summary
ConstructorsConstructorDescriptionAggregateSpec(AggregationType type, AggregateParams parameters) Creates an instance of aAggregateSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static AggregateSpecfrom(AggregationType type, Map<String, Object> values) Creates a spec from a flat parameters map, such as anAggregatedEntry.parameters()payload.final inthashCode()Returns a hash code value for this object.id()Returnstype().id().static AggregateSpecof(AggregationType type) Creates the spec of an unparameterized aggregate.Returns the value of theparametersrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
AggregateSpec
Creates an instance of aAggregateSpecrecord class.- Parameters:
type- the value for thetyperecord componentparameters- the value for theparametersrecord component
-
-
Method Details
-
of
Creates the spec of an unparameterized aggregate.- Parameters:
type- the aggregate; its schema must beParameterSchema.EMPTY.- Returns:
- the spec, carrying
NoParams.INSTANCE.
-
from
Creates a spec from a flat parameters map, such as anAggregatedEntry.parameters()payload. Keys the map lacks take each field's declared default; an aggregate with an empty schema yieldsNoParams.INSTANCEwhatever the map holds.- Parameters:
type- the aggregate.values- the parameter values by field name.- Returns:
- the spec.
-
id
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-