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 anAnnotation
instance. -
Method Summary
Modifier and TypeMethodDescriptionauthor()
Returns the value of theauthor
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.notes()
Returns the value of thenotes
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
Annotation
Constructs anAnnotation
instance.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 thenotes
record component.- Returns:
- the value of the
notes
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
author
Returns the value of theauthor
record component.- Returns:
- the value of the
author
record component
-