Interface AnnotationReference


  • public interface AnnotationReference
    A reference to an annotation.

    As annotations can change (though their id and content stays the same) we can't simply hold Annotation in Java objects. Instead we hold a reference to them (based on content and annotation ids).

    Since an content or annotation may be deleted, we do not know if the annotation still exists when we call toAnnotation.

    • Method Detail

      • toAnnotations

        static Stream<Annotation> toAnnotations​(Stream<AnnotationReference> references)
        Convert a stream of annotation references to annotations
        Parameters:
        references - reference to convert (may be null)
        Returns:
        annotations
      • getContentId

        String getContentId()
        The id of the content to which this annotation belongs.
        Returns:
        the content id
      • getAnnotationId

        String getAnnotationId()
        The annotation's id
        Returns:
        the id
      • toAnnotation

        Optional<Annotation> toAnnotation()
        Convert the reference to an annotations.

        Since the underlying content or annotation may have been deleted this returns an optional.

        Returns:
        the annotation