Class DataPointFactory

java.lang.Object
com.inductiveautomation.historian.common.model.data.DataPointFactory

public class DataPointFactory extends Object
A factory class for creating various types of data points, including atomic and aggregated points.

This class provides methods to create data points with specific value types, quality codes, timestamps, and sources. It also supports creating null points and converting data points to atomic points.

  • Method Details

    • createAtomicPoint

      public static <V> AtomicPoint<V> createAtomicPoint(QualifiedValue value, QualifiedPath source)
      Creates an atomic point from a QualifiedValue and a source.
      Type Parameters:
      V - The type of the value.
      Parameters:
      value - The qualified value containing the point's value, quality, and timestamp.
      source - The source of the point.
      Returns:
      The created atomic point.
    • createAtomicPoint

      public static <V> AtomicPoint<V> createAtomicPoint(V value, QualifiedPath source)
      Creates an atomic point with a value and source.
      Type Parameters:
      V - The type of the value.
      Parameters:
      value - The value of the point.
      source - The source of the point.
      Returns:
      The created atomic point.
    • createAtomicPoint

      public static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, QualifiedPath source)
      Creates an atomic point with a value, quality, and source.
      Type Parameters:
      V - The type of the value.
      Parameters:
      value - The value of the point.
      quality - The quality code of the point.
      source - The source of the point.
      Returns:
      The created atomic point.
    • createAtomicPoint

      public static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source)
      Creates an atomic point with a value, quality, timestamp, and source.
      Type Parameters:
      V - The type of the value.
      Parameters:
      value - The value of the point.
      quality - The quality code of the point.
      timestamp - The timestamp of the point.
      source - The source of the point.
      Returns:
      The created atomic point.
    • createAtomicPoint

      public static <V> AtomicPoint<V> createAtomicPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source, @Nullable @Nullable Instant snapshotTimestamp)
      Creates an atomic point with a value, quality, timestamp, source, and snapshot timestamp.
      Type Parameters:
      V - The type of the value.
      Parameters:
      value - The value of the point.
      quality - The quality code of the point.
      timestamp - The timestamp of the point.
      source - The source of the point.
      snapshotTimestamp - The snapshot timestamp of the point (nullable).
      Returns:
      The created atomic point.
      Throws:
      IllegalArgumentException - If the value type is unsupported.
    • createNullPoint

      public static <V> AtomicPoint<V> createNullPoint(QualifiedPath source)
      Creates a null atomic point with a default quality code and timestamp.
      Type Parameters:
      V - The type of the value.
      Parameters:
      source - The source of the point.
      Returns:
      The created null atomic point.
    • createNullPoint

      public static <V> AtomicPoint<V> createNullPoint(QualifiedPath source, QualityCode quality)
      Creates a null atomic point with the specified quality code and a default timestamp.
      Type Parameters:
      V - The type of the value.
      Parameters:
      source - The source of the point.
      quality - The quality code of the point.
      Returns:
      The created null atomic point.
    • createNullPoint

      public static <V> AtomicPoint<V> createNullPoint(QualifiedPath source, QualityCode quality, Instant timestamp)
      Creates a null atomic point with the specified quality code and timestamp.
      Type Parameters:
      V - The type of the value.
      Parameters:
      source - The source of the point.
      quality - The quality code of the point.
      timestamp - The timestamp of the point.
      Returns:
      The created null atomic point.
    • createNullPoint

      public static <V> AtomicPoint<V> createNullPoint(Class<V> valueClass, QualityCode quality, QualifiedPath source)
      Creates a null atomic point with the specified value class, quality code, and source.
      Type Parameters:
      V - The type of the value.
      Parameters:
      valueClass - The class of the value type.
      quality - The quality code of the point.
      source - The source of the point.
      Returns:
      The created null atomic point.
    • createNullPoint

      public static <V> AtomicPoint<V> createNullPoint(Class<V> valueClass, QualityCode quality, Instant timestamp, QualifiedPath source)
      Creates a null atomic point with the specified value class, quality code, timestamp, and source.
      Type Parameters:
      V - The type of the value.
      Parameters:
      valueClass - The class of the value type.
      quality - The quality code of the point.
      timestamp - The timestamp of the point.
      source - The source of the point.
      Returns:
      The created null atomic point.
    • createAggregatedPoint

      public static <V, A extends AggregationType> AggregatedDataPoint<V,A> createAggregatedPoint(AtomicPoint<V> dataPoint, A aggregationType)
      Creates an aggregated data point from an atomic data point and an aggregation type.
      Type Parameters:
      V - The type of the value in the data point.
      A - The type of the aggregation, which extends AggregationType.
      Parameters:
      dataPoint - The atomic data point to aggregate.
      aggregationType - The type of aggregation to apply.
      Returns:
      An AggregatedDataPoint created from the given atomic data point and aggregation type.
    • createAggregatedPoint

      public static <V, A extends AggregationType> AggregatedDataPoint<V,A> createAggregatedPoint(V value, QualityCode quality, Instant timestamp, QualifiedPath source, A aggregationType)
      Creates an aggregated data point with the specified value, quality, timestamp, source, and aggregation type.
      Type Parameters:
      V - The type of the value in the data point.
      A - The type of the aggregation, which extends AggregationType.
      Parameters:
      value - The value of the data point.
      quality - The quality code of the data point.
      timestamp - The timestamp of the data point.
      source - The source of the data point.
      aggregationType - The type of aggregation to apply.
      Returns:
      An AggregatedDataPoint created with the specified parameters.
    • convertToAtomicPoint

      public static <V> AtomicPoint<V> convertToAtomicPoint(DataPoint<V> dataPoint)
      Converts a generic data point to an atomic data point.

      If the given data point is already an instance of AtomicPoint, it is returned as-is. Otherwise, a new AtomicPoint is created using the value, quality, timestamp, source, and optional snapshot timestamp of the given data point.

      Type Parameters:
      V - The type of the value in the data point.
      Parameters:
      dataPoint - The data point to convert.
      Returns:
      An AtomicPoint representation of the given data point.