Record Class AnnotationChangePoint
- Record Components:
identifier
- A uniqueUUID
identifying the annotation change. Must not be null.source
- TheQualifiedPath
representing the source of the annotation. Must not be null.timestamp
- TheInstant
representing the timestamp of the change. Defaults to the current time if null.value
- TheAnnotationPoint
value of the annotation change, ornull
if it represents a deletion.
- All Implemented Interfaces:
ChangePoint<AnnotationPoint>
,TemporalPoint<AnnotationPoint,
,ChangePointType> Comparable<TemporalPoint<AnnotationPoint,
ChangePointType>>
This record implements ChangePoint
with a value type of AnnotationPoint
.
It encapsulates metadata and temporal information about an annotation change, including
its identifier, source, timestamp, and the new annotation value. If the value is null
,
it represents a deletion.
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationChangePoint
(UUID identifier, QualifiedPath source, Instant timestamp, AnnotationPoint value) Constructs anAnnotationChangePoint
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationChangePoint
delete
(UUID identifier, QualifiedPath source, Instant timestamp) Creates an annotation deletion change point.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theidentifier
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 the annotation change point.static AnnotationChangePoint
update
(UUID identifier, QualifiedPath source, Instant timestamp, AnnotationPoint newValue) Creates an annotation update change point.Retrieves the updated annotation point.value()
Returns the value of thevalue
record component.withSource
(QualifiedPath source) Creates a newAnnotationChangePoint
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.ChangePoint
isDeletion
Methods inherited from interface com.inductiveautomation.historian.common.model.data.TemporalPoint
compareTo
-
Constructor Details
-
AnnotationChangePoint
public AnnotationChangePoint(UUID identifier, QualifiedPath source, Instant timestamp, @Nullable AnnotationPoint value) Constructs anAnnotationChangePoint
instance.Validates that the required fields are not null and ensures that the identifier matches the value's identifier if the value is not null.
- Parameters:
identifier
- The identifier associated with this annotation. Must not be null.source
- The source associated with the annotation. Must not be null.value
- The new annotation value, ornull
for deletion.- Throws:
NullPointerException
- Ifidentifier
orsource
is null.IllegalArgumentException
- If the value's identifier does not match the provided identifier.
-
-
Method Details
-
type
Retrieves the type of the annotation change point.By default, this method returns
StandardChangePointType.ANNOTATION_CHANGE
.- Specified by:
type
in interfaceChangePoint<AnnotationPoint>
- Specified by:
type
in interfaceTemporalPoint<AnnotationPoint,
ChangePointType> - Returns:
- The
StandardChangePointType
of the annotation change point.
-
withSource
Creates a newAnnotationChangePoint
with the specified source.If the source is the same as the current source, the existing instance is returned.
- Parameters:
source
- The newQualifiedPath
source.- Returns:
- A new
AnnotationChangePoint
with the updated source, or the current instance if unchanged.
-
updatedAnnotationPoint
Retrieves the updated annotation point.- Returns:
- The
AnnotationPoint
representing the updated annotation, ornull
if it represents a deletion.
-
update
public static AnnotationChangePoint update(UUID identifier, QualifiedPath source, Instant timestamp, AnnotationPoint newValue) Creates an annotation update change point.This factory method constructs a new
AnnotationChangePoint
representing an update with the specified identifier, source, timestamp, and new annotation value.- Parameters:
identifier
- The identifier associated with the annotation. Must not be null.source
- The source path associated with the annotation. Must not be null.timestamp
- The timestamp of the update. Must not be null.newValue
- The new annotation value. Must not be null.- Returns:
- A new
AnnotationChangePoint
representing an update.
-
delete
public static AnnotationChangePoint delete(UUID identifier, QualifiedPath source, Instant timestamp) Creates an annotation deletion change point.This factory method constructs a new
AnnotationChangePoint
representing a deletion with the specified identifier, source, and timestamp.- Parameters:
identifier
- The identifier associated with the annotation. Must not be null.source
- The source path associated with the annotation. Must not be null.timestamp
- The timestamp of the deletion. Must not be null.- Returns:
- A new
AnnotationChangePoint
representing a deletion.
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
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 withObjects::equals(Object,Object)
. -
identifier
Returns the value of theidentifier
record component.- Returns:
- the value of the
identifier
record component
-
source
Returns the value of thesource
record component.- Specified by:
source
in interfaceTemporalPoint<AnnotationPoint,
ChangePointType> - Returns:
- the value of the
source
record component
-
timestamp
Returns the value of thetimestamp
record component.- Specified by:
timestamp
in interfaceTemporalPoint<AnnotationPoint,
ChangePointType> - Returns:
- the value of the
timestamp
record component
-
value
Returns the value of thevalue
record component.- Specified by:
value
in interfaceChangePoint<AnnotationPoint>
- Specified by:
value
in interfaceTemporalPoint<AnnotationPoint,
ChangePointType> - Returns:
- the value of the
value
record component
-