Record Class Annotation
java.lang.Object
java.lang.Record
com.inductiveautomation.historian.common.model.data.Annotation
- Record Components:
notes- The notes associated with the annotation. If null, it is converted to an empty string.type- The type of the annotation. Must not be null.- The author of the annotation. Defaults to "unknown" if null.
Represents an annotation in the historian system.
This record encapsulates metadata about an annotation, including its notes, type, and author. It ensures that the type is not null, assigns a default value of "unknown" to the author if null, and converts the notes to a non-null string representation.
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotation(String notes, String type, String author) Constructs anAnnotationinstance. -
Method Summary
Modifier and TypeMethodDescriptionauthor()Returns the value of theauthorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.notes()Returns the value of thenotesrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Annotation
Constructs anAnnotationinstance.Validates that the type is not null, assigns a default value to the author if null, and ensures the notes are converted to a non-null string.
- Throws:
NullPointerException- If the type is null.
-
-
Method Details
-
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). -
notes
Returns the value of thenotesrecord component.- Returns:
- the value of the
notesrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
author
Returns the value of theauthorrecord component.- Returns:
- the value of the
authorrecord component
-