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 class
A builder class for constructingMetadataPoint
instances. -
Constructor Summary
ConstructorsConstructorDescriptionMetadataPoint
(PropertySet value, QualityCode quality, Instant timestamp, QualifiedPath source) Constructs aMetadataPoint
with null checks and default values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataPoint.Builder
builder()
Creates a newMetadataPoint.Builder
for constructingMetadataPoint
instances.static MetadataPoint.Builder
builder
(MetadataPoint metadataPoint) Creates a newMetadataPoint.Builder
initialized with the values of the givenMetadataPoint
.static MetadataPoint
empty
(QualifiedPath source) Creates an emptyMetadataPoint
with the given source.boolean
Checks if this metadata point is equal to another object.static MetadataPoint
from
(PropertySet value, QualifiedPath source) Creates a newMetadataPoint
from the given value and source.int
hashCode()
Computes the hash code for this metadata point.quality()
Returns the value of thequality
record component.source()
Returns the value of thesource
record component.Returns the value of thetimestamp
record component.final String
toString()
Returns a string representation of this record class.type()
Retrieves the type of this metadata point.value()
Returns the value of thevalue
record component.withSource
(QualifiedPath source) Creates a newMetadataPoint
with the specified source.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 aMetadataPoint
with 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.EMPTY
if null.quality
- The quality code, defaults toQualityCode.Good
if null.timestamp
- The timestamp, defaults to the current time if null.source
- The source path, must not be null.
-
-
Method Details
-
from
Creates a newMetadataPoint
from the given value and source.- Parameters:
value
- The property set value.source
- The source path.- Returns:
- A new
MetadataPoint
instance.
-
empty
Creates an emptyMetadataPoint
with the given source.- Parameters:
source
- The source path.- Returns:
- A new
MetadataPoint
instance with an empty value.
-
type
Retrieves the type of this metadata point.- Specified by:
type
in interfaceComplexPoint<PropertySet>
- Specified by:
type
in 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 newMetadataPoint
with the specified source.- Parameters:
source
- The new source path.- Returns:
- A new
MetadataPoint
instance with the updated source.
-
builder
Creates a newMetadataPoint.Builder
for constructingMetadataPoint
instances.- Returns:
- A new
MetadataPoint.Builder
.
-
builder
Creates a newMetadataPoint.Builder
initialized 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 thevalue
record component.- Specified by:
value
in interfaceTemporalPoint<PropertySet,
ComplexPointType> - Returns:
- the value of the
value
record component
-
quality
Returns the value of thequality
record component.- Returns:
- the value of the
quality
record component
-
timestamp
Returns the value of thetimestamp
record component.- Specified by:
timestamp
in interfaceTemporalPoint<PropertySet,
ComplexPointType> - Returns:
- the value of the
timestamp
record component
-
source
Returns the value of thesource
record component.- Specified by:
source
in interfaceTemporalPoint<PropertySet,
ComplexPointType> - Returns:
- the value of the
source
record component
-