-
- All Superinterfaces:
WithId,WithProperties,WithType
public interface Group extends WithId, WithType, WithProperties
Base annotation interface from which all other annotations extend.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceGroup.BuilderBuilder interface to create (immutable) Group classes
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancontainsAnnotation(Annotation annotation)Check if the annotation is included in the group.default booleancontainsRole(String role)Check if role is included in the groupdefault Map<String,Stream<Annotation>>getAnnotations()The roles with the associated annotations in this groupdefault Stream<Annotation>getAnnotations(String role)All the annotations in this group with the specified roledefault Stream<Annotation>getAnnotationsForContent(Content content)Return all the annotations in this group for the specified content.default Stream<Annotation>getAnnotationsForContentAndRole(Content content, String role)Return all the annotations in this group for the specified content and role.Map<String,Stream<AnnotationReference>>getReferences()The associated annotations references in this groupOptional<String>getRole(Annotation annotation)Get the role of a specific annotation in this groupdefault Stream<String>getRoles()Return all the roles currently associated with annotations in this groupdefault booleansameGroup(Group other)Do two instances represent the same underlying group?-
Methods inherited from interface io.annot8.core.helpers.WithProperties
getProperties
-
-
-
-
Method Detail
-
getAnnotations
default Map<String,Stream<Annotation>> getAnnotations()
The roles with the associated annotations in this group- Returns:
- a map of all roles
-
getReferences
Map<String,Stream<AnnotationReference>> getReferences()
The associated annotations references in this group- Returns:
- a map of all references
-
getAnnotations
default Stream<Annotation> getAnnotations(String role)
All the annotations in this group with the specified role- Parameters:
role- the role required- Returns:
- stream of annotations having that role
-
getRoles
default Stream<String> getRoles()
Return all the roles currently associated with annotations in this group- Returns:
- distinct roles
-
getRole
Optional<String> getRole(Annotation annotation)
Get the role of a specific annotation in this group- Parameters:
annotation- the annotation to look for- Returns:
- the role for a specific annotation, or empty if the annotation is not found
-
getAnnotationsForContent
default Stream<Annotation> getAnnotationsForContent(Content content)
Return all the annotations in this group for the specified content.- Parameters:
content- the content- Returns:
- annotations in that content
-
getAnnotationsForContentAndRole
default Stream<Annotation> getAnnotationsForContentAndRole(Content content, String role)
Return all the annotations in this group for the specified content and role.- Parameters:
content- the content to limit torole- the role to filter on- Returns:
- annotation in that content of that role
-
containsAnnotation
boolean containsAnnotation(Annotation annotation)
Check if the annotation is included in the group.- Parameters:
annotation- the annotation to look for- Returns:
- true if this group contains the specified annotation
-
containsRole
default boolean containsRole(String role)
Check if role is included in the group- Parameters:
role- the role to look for- Returns:
- true if this group contains at least one annotation with the specified role
-
sameGroup
default boolean sameGroup(Group other)
Do two instances represent the same underlying group?That is do they have the same id, even if they are different revisions.
- Parameters:
other- the annotation to check against- Returns:
- true if they are the same (id)
-
-