Record Class MetadataPoint

java.lang.Object
java.lang.Record
com.inductiveautomation.historian.common.model.data.MetadataPoint
All Implemented Interfaces:
ComplexPoint<PropertySet>, TemporalPoint<PropertySet, ComplexPointType>, Comparable<TemporalPoint<PropertySet, ComplexPointType>>

public record MetadataPoint(PropertySet value, QualityCode quality, Instant timestamp, QualifiedPath source) extends Record implements ComplexPoint<PropertySet>
Metadata for a source: a ComplexPoint whose value is a PropertySet, with a quality, timestamp and source.
  • Constructor Details

    • MetadataPoint

      public MetadataPoint(PropertySet value, QualityCode quality, Instant timestamp, QualifiedPath source)
      Creates a point. A null value defaults to PropertySet.EMPTY, a null quality to QualityCode.Good and a null timestamp to now.
      Parameters:
      value - the properties.
      quality - the quality.
      timestamp - the timestamp.
      source - the source path; must not be null.
  • Method Details

    • from

      public static MetadataPoint from(PropertySet value, QualifiedPath source)
      Creates a point with good quality, timestamped now.
      Parameters:
      value - the properties.
      source - the source path.
      Returns:
      the new point.
    • empty

      public static MetadataPoint empty(QualifiedPath source)
      Creates a point with no properties.
      Parameters:
      source - the source path.
      Returns:
      the new point.
    • type

      public StandardComplexPointType type()
      Specified by:
      type in interface ComplexPoint<PropertySet>
      Specified by:
      type in interface TemporalPoint<PropertySet, ComplexPointType>
      Returns:
      the point type.
    • equals

      public 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • hashCode

      public 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
    • withSource

      public MetadataPoint withSource(QualifiedPath source)
      Returns a copy with a different source.
      Parameters:
      source - the new source path.
      Returns:
      the point with the new source.
    • builder

      public static MetadataPoint.Builder builder()
      Creates a builder.
      Returns:
      a new builder.
    • builder

      public static MetadataPoint.Builder builder(MetadataPoint metadataPoint)
      Creates a builder initialized from an existing point.
      Parameters:
      metadataPoint - the point to copy.
      Returns:
      a new builder.
    • 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
    • value

      public PropertySet value()
      Returns the value of the value record component.
      Specified by:
      value in interface TemporalPoint<PropertySet, ComplexPointType>
      Returns:
      the value of the value record component
    • quality

      public QualityCode quality()
      Returns the value of the quality record component.
      Returns:
      the value of the quality record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Specified by:
      timestamp in interface TemporalPoint<PropertySet, ComplexPointType>
      Returns:
      the value of the timestamp record component
    • source

      public QualifiedPath source()
      Returns the value of the source record component.
      Specified by:
      source in interface TemporalPoint<PropertySet, ComplexPointType>
      Returns:
      the value of the source record component