Class DefaultAnnotations.Builder

  • Enclosing class:
    DefaultAnnotations

    public static final class DefaultAnnotations.Builder
    extends Object
    Facility for gradually building model annotations.
    • Method Detail

      • putAll

        public DefaultAnnotations.Builder putAll​(Annotations base)
        Adds all specified annotation. Any previous value associated with the given annotations will be overwritten.
        Parameters:
        base - annotations
        Returns:
        self
      • putAll

        public DefaultAnnotations.Builder putAll​(Map<String,​String> entries)
        Adds all entries in specified map. Any previous entries with same key will be overwritten.
        Parameters:
        entries - annotation key and value entries
        Returns:
        self
      • set

        public DefaultAnnotations.Builder set​(String key,
                                              String value)
        Adds the specified annotation. Any previous value associated with the given annotation key will be overwritten.
        Parameters:
        key - annotation key
        value - annotation value
        Returns:
        self
      • remove

        public DefaultAnnotations.Builder remove​(String key)
        Adds the specified annotation. Any previous value associated with the given annotation key will be tagged for removal.
        Parameters:
        key - annotation key
        Returns:
        self
      • build

        public DefaultAnnotations build()
        Returns immutable annotations built from the accrued key/values pairs. Any removed annotation tombstones will be preserved.
        Returns:
        annotations
      • buildCompressed

        public DefaultAnnotations buildCompressed()
        Returns immutable annotations built from the accrued key/values pairs after compressing them to eliminate removed annotation tombstones.
        Returns:
        annotations