Interface AnnotationStore

    • Method Detail

      • getContent

        Content<?> getContent()
        Get the content which this store holds annotations for.
        Returns:
        content
      • getBuilder

        Annotation.Builder getBuilder()
        Get a new annotation builder
        Returns:
        a builder object for the supported annotations
      • create

        default Annotation.Builder create()
        Get a builder to createContent a new annotation
        Returns:
        a builder to createContent a new annotation
      • copy

        default Annotation.Builder copy​(Annotation existing)
        Clone an existing annotation to createContent a new annotation
        Parameters:
        existing - the annotation to copy
        Returns:
        a builder to based on the an existing annotation, but don't overwrite that annotation on save.
      • edit

        default Annotation.Builder edit​(Annotation existing)
        Edit an annotation (saving will replace the old version)
        Parameters:
        existing - the annotation to edit
        Returns:
        a builder to edit an existing annotation
      • delete

        void delete​(Annotation annotation)
        Delete an annotation from the store
        Parameters:
        annotation - the annotation to delete
      • delete

        default void delete​(Collection<Annotation> annotations)
        Delete a collection of annotations from the store
        Parameters:
        annotations - the annotations to delete
      • deleteAll

        default void deleteAll()
        Delete all annotations from the store
      • getAll

        Stream<Annotation> getAll()
        Get all annotations currently held in this store
        Returns:
        annotations
      • getByType

        default Stream<Annotation> getByType​(String type)
        Get all annotations of a given type currently held in this store
        Parameters:
        type - the annotation type to find
        Returns:
        annotations
      • getByBounds

        default <B extends BoundsStream<Annotation> getByBounds​(Class<B> boundsClass)
        Get all annotations of a given bounds currently held in this store
        Type Parameters:
        B - bounds class
        Parameters:
        boundsClass - the bound to filter on
        Returns:
        annotations
      • getByBoundsAndType

        default <B extends BoundsStream<Annotation> getByBoundsAndType​(Class<B> boundsClass,
                                                                         String type)
        Get all annotations of a given bounds and type currently held in this store
        Type Parameters:
        B - bounds class
        Parameters:
        boundsClass - the bound to filter on
        type - the annotation type to find
        Returns:
        annotations
      • getById

        Optional<Annotation> getById​(String annotationId)
        Get the annotation with the given ID, if it is currently held in this store
        Parameters:
        annotationId - the id
        Returns:
        annotation