-
- All Superinterfaces:
WithId,WithProperties,WithType
public interface Annotation extends WithId, WithType, WithProperties
Base annotation interface from which all other annotations extend.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAnnotation.BuilderBuilder interface to create (immutable) Annotation classes
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description BoundsgetBounds()Get theBoundsassociated with this annotationdefault <B extends Bounds>
Optional<B>getBounds(Class<B> boundsClass)Get theBoundsassociated with this annotation casting it to the bounds provided (if it is of that type / subtype).StringgetContentId()Get the id of the Content to which this annotation refersdefault booleansameAnnotation(Annotation other)Do two instances represent the same underlying annotations?-
Methods inherited from interface io.annot8.core.helpers.WithProperties
getProperties
-
-
-
-
Method Detail
-
getBounds
default <B extends Bounds> Optional<B> getBounds(Class<B> boundsClass)
Get theBoundsassociated with this annotation casting it to the bounds provided (if it is of that type / subtype).- Parameters:
boundsClass- the class the bounds should have- Returns:
- optional bounds of requested class, empty if the bounds are not of that class
-
getContentId
String getContentId()
Get the id of the Content to which this annotation refers- Returns:
- content id
-
sameAnnotation
default boolean sameAnnotation(Annotation other)
Do two instances represent the same underlying annotations?That is do they have the same id, even if the rest of the data is different.
- Parameters:
other- the annotation to test against- Returns:
- true is non-null and have the same id
-
-