Class Annotation

  • Direct Known Subclasses:
    AutoValue_Annotation

    @Immutable
    public abstract class Annotation
    extends java.lang.Object
    A text annotation with a set of attributes.
    Since:
    0.5
    • Field Detail

      • EMPTY_ATTRIBUTES

        private static final java.util.Map<java.lang.String,​AttributeValue> EMPTY_ATTRIBUTES
    • Constructor Detail

      • Annotation

        Annotation()
    • Method Detail

      • fromDescription

        public static Annotation fromDescription​(java.lang.String description)
        Returns a new Annotation with the given description.
        Parameters:
        description - the text description of the Annotation.
        Returns:
        a new Annotation with the given description.
        Throws:
        java.lang.NullPointerException - if description is null.
        Since:
        0.5
      • fromDescriptionAndAttributes

        public static Annotation fromDescriptionAndAttributes​(java.lang.String description,
                                                              java.util.Map<java.lang.String,​AttributeValue> attributes)
        Returns a new Annotation with the given description and set of attributes.
        Parameters:
        description - the text description of the Annotation.
        attributes - the attributes of the Annotation.
        Returns:
        a new Annotation with the given description and set of attributes.
        Throws:
        java.lang.NullPointerException - if description or attributes are null.
        Since:
        0.5
      • getDescription

        public abstract java.lang.String getDescription()
        Return the description of the Annotation.
        Returns:
        the description of the Annotation.
        Since:
        0.5
      • getAttributes

        public abstract java.util.Map<java.lang.String,​AttributeValue> getAttributes()
        Return the attributes of the Annotation.
        Returns:
        the attributes of the Annotation.
        Since:
        0.5