Interface Group

    • Method Detail

      • getAnnotations

        default Map<String,Stream<Annotation>> getAnnotations​()
        The roles with the associated annotations in this group
        Returns:
        a map of all roles
      • 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 to
        role - 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)