Record Class AnnotationChangePoint
- Record Components:
identifier- A uniqueUUIDidentifying the annotation change. Must not be null.source- TheQualifiedPathrepresenting the source of the annotation. Must not be null.timestamp- TheInstantrepresenting the timestamp of the change. Defaults to the current time if null.value- TheAnnotationPointvalue of the annotation change, ornullif 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 anAnnotationChangePointinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationChangePointdelete(UUID identifier, QualifiedPath source, Instant timestamp) Creates an annotation deletion change point.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theidentifierrecord 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 the annotation change point.static AnnotationChangePointupdate(UUID identifier, QualifiedPath source, Instant timestamp, AnnotationPoint newValue) Creates an annotation update change point.Retrieves the updated annotation point.value()Returns the value of thevaluerecord component.withSource(QualifiedPath source) Creates a newAnnotationChangePointwith 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.ChangePoint
isDeletionMethods 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 anAnnotationChangePointinstance.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, ornullfor deletion.- Throws:
NullPointerException- Ifidentifierorsourceis 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:
typein interfaceChangePoint<AnnotationPoint>- Specified by:
typein interfaceTemporalPoint<AnnotationPoint,ChangePointType> - Returns:
- The
StandardChangePointTypeof the annotation change point.
-
withSource
Creates a newAnnotationChangePointwith the specified source.If the source is the same as the current source, the existing instance is returned.
- Parameters:
source- The newQualifiedPathsource.- Returns:
- A new
AnnotationChangePointwith the updated source, or the current instance if unchanged.
-
updatedAnnotationPoint
Retrieves the updated annotation point.- Returns:
- The
AnnotationPointrepresenting the updated annotation, ornullif 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
AnnotationChangePointrepresenting 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
AnnotationChangePointrepresenting 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
AnnotationChangePointrepresenting 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
AnnotationChangePointrepresenting 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 theidentifierrecord component.- Returns:
- the value of the
identifierrecord component
-
source
Returns the value of thesourcerecord component.- Specified by:
sourcein interfaceTemporalPoint<AnnotationPoint,ChangePointType> - Returns:
- the value of the
sourcerecord component
-
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceTemporalPoint<AnnotationPoint,ChangePointType> - Returns:
- the value of the
timestamprecord component
-
value
Returns the value of thevaluerecord component.- Specified by:
valuein interfaceChangePoint<AnnotationPoint>- Specified by:
valuein interfaceTemporalPoint<AnnotationPoint,ChangePointType> - Returns:
- the value of the
valuerecord component
-