Class DataPointFactory
java.lang.Object
com.inductiveautomation.historian.common.model.data.DataPointFactory
Static factory for
AtomicPoint, AggregatedDataPoint and null points.
Supported value types are Boolean, Byte, Short, Integer,
Long, Float, Double, String and Date. Overloads that omit
the quality default to QualityCode.Good, and those that omit the timestamp default to the
current time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> AtomicPoint<V> convertToAtomicPoint(DataPoint<V> dataPoint) Converts a data point to anAtomicPoint, returning it unchanged if it already is one.static <V, A extends AggregationType>
AggregatedDataPoint<V, A> createAggregatedPoint(AtomicPoint<V> dataPoint, A aggregationType) Wraps an atomic point as an aggregated point.static <V, A extends AggregationType>
AggregatedDataPoint<V, A> createAggregatedPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source, A aggregationType) Creates an aggregated point.static <V> AtomicPoint<V> createAtomicPoint(QualifiedValue value, QualifiedPath source) Creates an atomic point from a qualified value, taking its value, quality and timestamp.static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, QualifiedPath source) Creates an atomic point timestamped now.static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source) Creates an atomic point.static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source, @Nullable Instant snapshotTimestamp) Creates an atomic point with a snapshot timestamp.static <V> AtomicPoint<V> createAtomicPoint(V value, QualifiedPath source) Creates a good-quality atomic point timestamped now.static <V> AtomicPoint<V> createNullPoint(QualifiedPath source) Creates a good-quality null point timestamped now.static <V> AtomicPoint<V> createNullPoint(QualifiedPath source, QualityCode quality) Creates a null point timestamped now.static <V> AtomicPoint<V> createNullPoint(QualifiedPath source, QualityCode quality, Instant timestamp) Creates a null point.static <V> AtomicPoint<V> createNullPoint(Class<V> valueClass, QualityCode quality, QualifiedPath source) Creates a null point that remembers its intended value type, timestamped now.static <V> AtomicPoint<V> createNullPoint(Class<V> valueClass, QualityCode quality, Instant timestamp, QualifiedPath source) Creates a null point that remembers its intended value type.
-
Method Details
-
createAtomicPoint
Creates an atomic point from a qualified value, taking its value, quality and timestamp.- Type Parameters:
V- the value type.- Parameters:
value- the qualified value to convert.source- the path of the point's source.- Returns:
- the new point.
- Throws:
IllegalArgumentException- if the value type is unsupported.
-
createAtomicPoint
Creates a good-quality atomic point timestamped now.- Type Parameters:
V- the value type.- Parameters:
value- the point value.source- the path of the point's source.- Returns:
- the new point.
- Throws:
IllegalArgumentException- if the value type is unsupported.
-
createAtomicPoint
public static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, QualifiedPath source) Creates an atomic point timestamped now.- Type Parameters:
V- the value type.- Parameters:
value- the point value.quality- the point quality.source- the path of the point's source.- Returns:
- the new point.
- Throws:
IllegalArgumentException- if the value type is unsupported.
-
createAtomicPoint
public static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source) Creates an atomic point.- Type Parameters:
V- the value type.- Parameters:
value- the point value.quality- the point quality.timestamp- the point timestamp.source- the path of the point's source.- Returns:
- the new point.
- Throws:
IllegalArgumentException- if the value type is unsupported.
-
createAtomicPoint
public static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source, @Nullable Instant snapshotTimestamp) Creates an atomic point with a snapshot timestamp. Anullvalue yields a null point, and aDatesubclass such asjava.sql.Timestampis stored as a plainDate.- Type Parameters:
V- the value type.- Parameters:
value- the point value; may benull.quality- the point quality.timestamp- the point timestamp.source- the path of the point's source.snapshotTimestamp- when the value was snapshotted, ornullif not applicable.- Returns:
- the new point.
- Throws:
IllegalArgumentException- if the value type is unsupported.
-
createNullPoint
Creates a good-quality null point timestamped now.- Type Parameters:
V- the value type.- Parameters:
source- the path of the point's source.- Returns:
- the new point.
-
createNullPoint
Creates a null point timestamped now.- Type Parameters:
V- the value type.- Parameters:
source- the path of the point's source.quality- the point quality.- Returns:
- the new point.
-
createNullPoint
public static <V> AtomicPoint<V> createNullPoint(QualifiedPath source, QualityCode quality, Instant timestamp) Creates a null point.- Type Parameters:
V- the value type.- Parameters:
source- the path of the point's source.quality- the point quality.timestamp- the point timestamp.- Returns:
- the new point.
-
createNullPoint
public static <V> AtomicPoint<V> createNullPoint(Class<V> valueClass, QualityCode quality, QualifiedPath source) Creates a null point that remembers its intended value type, timestamped now.- Type Parameters:
V- the value type.- Parameters:
valueClass- the intended value type.quality- the point quality.source- the path of the point's source.- Returns:
- the new point.
-
createNullPoint
public static <V> AtomicPoint<V> createNullPoint(Class<V> valueClass, QualityCode quality, Instant timestamp, QualifiedPath source) Creates a null point that remembers its intended value type.- Type Parameters:
V- the value type.- Parameters:
valueClass- the intended value type.quality- the point quality.timestamp- the point timestamp.source- the path of the point's source.- Returns:
- the new point.
-
createAggregatedPoint
public static <V, A extends AggregationType> AggregatedDataPoint<V,A> createAggregatedPoint(AtomicPoint<V> dataPoint, A aggregationType) Wraps an atomic point as an aggregated point.- Type Parameters:
V- the value type.A- the aggregation type.- Parameters:
dataPoint- the point carrying the aggregate value.aggregationType- the aggregation that produced it.- Returns:
- the aggregated point.
-
createAggregatedPoint
public static <V, A extends AggregationType> AggregatedDataPoint<V,A> createAggregatedPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source, A aggregationType) Creates an aggregated point.- Type Parameters:
V- the value type.A- the aggregation type.- Parameters:
value- the aggregate value.quality- the aggregate quality.timestamp- the aggregate timestamp.source- the path of the point's source.aggregationType- the aggregation that produced it.- Returns:
- the aggregated point.
-
convertToAtomicPoint
Converts a data point to anAtomicPoint, returning it unchanged if it already is one.- Type Parameters:
V- the value type.- Parameters:
dataPoint- the point to convert.- Returns:
- an atomic point with the same value, quality, timestamp, source and snapshot timestamp.
-