-
- All Superinterfaces:
WithFilter<Annotation>
public interface AnnotationStore extends WithFilter<Annotation>
Base annotations interface from which all other annotation stores extend.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Annotation.Buildercopy(Annotation existing)Clone an existing annotation to createContent a new annotationdefault Annotation.Buildercreate()Get a builder to createContent a new annotationvoiddelete(Annotation annotation)Delete an annotation from the storedefault voiddelete(Collection<Annotation> annotations)Delete a collection of annotations from the storedefault voiddeleteAll()Delete all annotations from the storedefault Annotation.Builderedit(Annotation existing)Edit an annotation (saving will replace the old version)default Stream<Annotation>filter(Filter<Annotation> filter)Filter annotations to match the test.Stream<Annotation>getAll()Get all annotations currently held in this storeAnnotation.BuildergetBuilder()Get a new annotation builderdefault <B extends Bounds>
Stream<Annotation>getByBounds(Class<B> boundsClass)Get all annotations of a given bounds currently held in this storedefault <B extends Bounds>
Stream<Annotation>getByBoundsAndType(Class<B> boundsClass, String type)Get all annotations of a given bounds and type currently held in this storeOptional<Annotation>getById(String annotationId)Get the annotation with the given ID, if it is currently held in this storedefault Stream<Annotation>getByType(String type)Get all annotations of a given type currently held in this storeContent<?>getContent()Get the content which this store holds annotations for.-
Methods inherited from interface io.annot8.api.helpers.WithFilter
find
-
-
-
-
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 Bounds> Stream<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 Bounds> Stream<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 ontype- 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
-
filter
default Stream<Annotation> filter(Filter<Annotation> filter)
Filter annotations to match the test.- Specified by:
filterin interfaceWithFilter<Annotation>- Parameters:
filter- the test to filter with- Returns:
- stream of matching annotations
-
-