Record Class AggregatedDataPoint<V, A extends AggregationType>
java.lang.Object
java.lang.Record
com.inductiveautomation.historian.common.model.data.AggregatedDataPoint<V,A>
- Type Parameters:
V- the value type.A- the aggregation type.
- All Implemented Interfaces:
AggregatedPoint<V,A>, DataPoint<V>, SnapshotCapable, TemporalPoint<V, DataPointType>, Comparable<TemporalPoint<V, DataPointType>>
public record AggregatedDataPoint<V, A extends AggregationType>(V value, QualityCode quality, Instant timestamp, QualifiedPath source, A extends AggregationType aggregationType, Optional<Instant> snapshotTimestamp, Optional<WindowExtent> extent)
extends Record
implements AggregatedPoint<V,A>
A data point holding an aggregate value, with its aggregation type and an optional
WindowExtent. A null quality defaults to QualityCode.Good and a null timestamp to now.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAggregatedDataPoint.Builder<V, A extends AggregationType>Builder forAggregatedDataPoint. -
Constructor Summary
ConstructorsConstructorDescriptionAggregatedDataPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source, A aggregationType, Optional<Instant> snapshotTimestamp, Optional<WindowExtent> extent) Validates the point. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaggregationTyperecord component.static <V, A extends AggregationType>
AggregatedDataPoint.Builder<V, A> builder(QualifiedPath source, A aggregationType) Creates a builder.final booleanIndicates whether some other object is "equal to" this one.extent()Returns the value of theextentrecord component.static <V, A extends AggregationType>
AggregatedDataPoint<V, A> Creates an aggregated point from an existing data point.final inthashCode()Returns a hash code value for this object.quality()Returns the value of thequalityrecord component.Returns the value of thesnapshotTimestamprecord component.source()Returns the value of thesourcerecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.withExtent(@Nullable WindowExtent extent) Returns a copy carrying the first and last stored samples of its window.withSnapshot(Instant snapshotTime) Returns a copy with a different snapshot timestamp.Methods inherited from interface AggregatedPoint
typeMethods inherited from interface DataPoint
valueClassMethods inherited from interface SnapshotCapable
isSnapshot, withSnapshotMethods inherited from interface TemporalPoint
compareTo
-
Constructor Details
-
AggregatedDataPoint
public AggregatedDataPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source, A aggregationType, Optional<Instant> snapshotTimestamp, Optional<WindowExtent> extent) Validates the point.- Throws:
NullPointerException- if the source or aggregation type is null.
-
-
Method Details
-
builder
public static <V, A extends AggregationType> AggregatedDataPoint.Builder<V,A> builder(QualifiedPath source, A aggregationType) Creates a builder.- Type Parameters:
V- the value type.A- the aggregation type.- Parameters:
source- the source; must not be null.aggregationType- the aggregation; must not be null.- Returns:
- a new builder.
-
from
public static <V, A extends AggregationType> AggregatedDataPoint<V,A> from(DataPoint<V> point, A aggregationType) Creates an aggregated point from an existing data point.- Type Parameters:
V- the value type.A- the aggregation type.- Parameters:
point- the data point; must not be null.aggregationType- the aggregation; must not be null.- Returns:
- the new point.
-
withSnapshot
Returns a copy with a different snapshot timestamp.- Specified by:
withSnapshotin interfaceSnapshotCapable- Parameters:
snapshotTime- the new snapshot timestamp; must not be null.- Returns:
- the new point.
-
withExtent
Returns a copy carrying the first and last stored samples of its window.- Parameters:
extent- the extent, ornullfor none.- Returns:
- the new point.
-
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). -
value
Returns the value of thevaluerecord component.- Specified by:
valuein interfaceDataPoint<V>- Specified by:
valuein interfaceTemporalPoint<V, A extends AggregationType>- Returns:
- the value of the
valuerecord component
-
quality
Returns the value of thequalityrecord component. -
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceTemporalPoint<V, A extends AggregationType>- Returns:
- the value of the
timestamprecord component
-
source
Returns the value of thesourcerecord component.- Specified by:
sourcein interfaceTemporalPoint<V, A extends AggregationType>- Returns:
- the value of the
sourcerecord component
-
aggregationType
Returns the value of theaggregationTyperecord component.- Specified by:
aggregationTypein interfaceAggregatedPoint<V, A extends AggregationType>- Returns:
- the value of the
aggregationTyperecord component
-
snapshotTimestamp
Returns the value of thesnapshotTimestamprecord component.- Specified by:
snapshotTimestampin interfaceSnapshotCapable- Returns:
- the value of the
snapshotTimestamprecord component
-
extent
Returns the value of theextentrecord component.- Specified by:
extentin interfaceAggregatedPoint<V, A extends AggregationType>- Returns:
- the value of the
extentrecord component
-