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>
Represents a metadata point in the historian system.
This record encapsulates the value, quality, timestamp, and source of a metadata point.
It implements the ComplexPoint interface with PropertySet as the type parameter.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for constructingMetadataPointinstances. -
Constructor Summary
ConstructorsConstructorDescriptionMetadataPoint(PropertySet value, QualityCode quality, Instant timestamp, QualifiedPath source) Constructs aMetadataPointwith null checks and default values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataPoint.Builderbuilder()Creates a newMetadataPoint.Builderfor constructingMetadataPointinstances.static MetadataPoint.Builderbuilder(MetadataPoint metadataPoint) Creates a newMetadataPoint.Builderinitialized with the values of the givenMetadataPoint.static MetadataPointempty(QualifiedPath source) Creates an emptyMetadataPointwith the given source.booleanChecks if this metadata point is equal to another object.static MetadataPointfrom(PropertySet value, QualifiedPath source) Creates a newMetadataPointfrom the given value and source.inthashCode()Computes the hash code for this metadata point.quality()Returns the value of thequalityrecord component.source()Returns the value of thesourcerecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.type()Retrieves the type of this metadata point.value()Returns the value of thevaluerecord component.withSource(QualifiedPath source) Creates a newMetadataPointwith the specified source.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.historian.common.model.data.TemporalPoint
compareTo
-
Constructor Details
-
MetadataPoint
public MetadataPoint(PropertySet value, QualityCode quality, Instant timestamp, QualifiedPath source) Constructs aMetadataPointwith null checks and default values.Ensures that the source is not null, and assigns default values for the other fields if they are null.
- Parameters:
value- The property set value, defaults toPropertySet.EMPTYif null.quality- The quality code, defaults toQualityCode.Goodif null.timestamp- The timestamp, defaults to the current time if null.source- The source path, must not be null.
-
-
Method Details
-
from
Creates a newMetadataPointfrom the given value and source.- Parameters:
value- The property set value.source- The source path.- Returns:
- A new
MetadataPointinstance.
-
empty
Creates an emptyMetadataPointwith the given source.- Parameters:
source- The source path.- Returns:
- A new
MetadataPointinstance with an empty value.
-
type
Retrieves the type of this metadata point.- Specified by:
typein interfaceComplexPoint<PropertySet>- Specified by:
typein interfaceTemporalPoint<PropertySet,ComplexPointType> - Returns:
- The type of the metadata point, which is
StandardComplexPointType.METADATA.
-
equals
Checks if this metadata point is equal to another object. -
hashCode
public int hashCode()Computes the hash code for this metadata point. -
withSource
Creates a newMetadataPointwith the specified source.- Parameters:
source- The new source path.- Returns:
- A new
MetadataPointinstance with the updated source.
-
builder
Creates a newMetadataPoint.Builderfor constructingMetadataPointinstances.- Returns:
- A new
MetadataPoint.Builder.
-
builder
Creates a newMetadataPoint.Builderinitialized with the values of the givenMetadataPoint.- Parameters:
metadataPoint- The metadata point to copy values from.- Returns:
- A new
MetadataPoint.Builder.
-
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. -
value
Returns the value of thevaluerecord component.- Specified by:
valuein interfaceTemporalPoint<PropertySet,ComplexPointType> - Returns:
- the value of the
valuerecord component
-
quality
Returns the value of thequalityrecord component.- Returns:
- the value of the
qualityrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceTemporalPoint<PropertySet,ComplexPointType> - Returns:
- the value of the
timestamprecord component
-
source
Returns the value of thesourcerecord component.- Specified by:
sourcein interfaceTemporalPoint<PropertySet,ComplexPointType> - Returns:
- the value of the
sourcerecord component
-