Class Annotation

    • Constructor Detail

      • Annotation

        public Annotation()
        Constructs an Annotation without a type. BEWARE! Should only be used during deserialization.
      • Annotation

        public Annotation​(AnnotationType type)
        Constructs a new annotation of the specified type.
        Parameters:
        type - the type of the new annotation
      • Annotation

        public Annotation​(Annotation other)
        Constructs a copy of the input annotation.
        Parameters:
        other - annotation
      • Annotation

        public Annotation​(AnnotationType type,
                          FieldValue value)
        Constructs a new annotation of the specified type, and having the specified value.
        Parameters:
        type - the type of the new annotation
        value - the value of the new annotation
        Throws:
        java.lang.UnsupportedOperationException - if the annotation type does not allow this annotation to have values.
    • Method Detail

      • setScratchId

        public void setScratchId​(int id)
      • getScratchId

        public int getScratchId()
      • getType

        public AnnotationType getType()
        Returns the type of this annotation.
        Returns:
        the type of this annotation
      • setType

        public void setType​(AnnotationType type)
        Sets the type of this annotation. BEWARE! Should only be used during deserialization.
        Parameters:
        type - the type of this annotation
      • hasSpanNode

        public boolean hasSpanNode()
        Returns true if this Annotation is associated with a SpanNode (irrespective of the SpanNode being valid or not).
        Returns:
        true if this Annotation is associated with a SpanNode, false otherwise.
        See Also:
        SpanNode.isValid()
      • isSpanNodeValid

        public boolean isSpanNodeValid()
        Returns true iff. this Annotation is associated with a SpanNode and the SpanNode is valid.
        Returns:
        true iff. this Annotation is associated with a SpanNode and the SpanNode is valid.
        See Also:
        SpanNode.isValid()
      • getSpanNode

        public SpanNode getSpanNode()
        Returns the SpanNode this Annotation is annotating, if any.
        Returns:
        the SpanNode this Annotation is annotating, or null
        Throws:
        java.lang.IllegalStateException - if this Annotation is associated with a SpanNode and the SpanNode is invalid.
      • getSpanNodeFast

        public final SpanNode getSpanNodeFast()
        Returns the SpanNode this Annotation is annotating, if any.
        Returns:
        the SpanNode this Annotation is annotating, or null
      • setSpanNode

        public void setSpanNode​(SpanNode spanNode)
        WARNING! Should only be used by deserializers! Sets the span node that this annotation points to.
        Parameters:
        spanNode - the span node that this annotation shall point to.
      • setSpanNodeFast

        public final void setSpanNodeFast​(SpanNode spanNode)
        WARNING! Should only be used by deserializers! Sets the span node that this annotation points to.
        Parameters:
        spanNode - the span node that this annotation shall point to.
      • getFieldValue

        public FieldValue getFieldValue()
        Returns the value of the annotation, if any.
        Returns:
        the value of the annotation, or null
      • setFieldValue

        public void setFieldValue​(FieldValue fieldValue)
        Sets the value of the annotation.
        Parameters:
        fieldValue - the value to set
        Throws:
        java.lang.UnsupportedOperationException - if the annotation type does not allow this annotation to have values.
      • hasFieldValue

        public boolean hasFieldValue()
        Returns true if this Annotation has a value.
        Returns:
        true if this Annotation has a value, false otherwise.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(Annotation annotation)
        Specified by:
        compareTo in interface java.lang.Comparable<Annotation>