Package org.onosproject.net
Class DefaultAnnotations.Builder
- java.lang.Object
-
- org.onosproject.net.DefaultAnnotations.Builder
-
- Enclosing class:
- DefaultAnnotations
public static final class DefaultAnnotations.Builder extends java.lang.ObjectFacility for gradually building model annotations.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultAnnotationsbuild()Returns immutable annotations built from the accrued key/values pairs.DefaultAnnotationsbuildCompressed()Returns immutable annotations built from the accrued key/values pairs after compressing them to eliminate removed annotation tombstones.DefaultAnnotations.BuilderputAll(java.util.Map<java.lang.String,java.lang.String> entries)Adds all entries in specified map.DefaultAnnotations.BuilderputAll(Annotations base)Adds all specified annotation.DefaultAnnotations.Builderremove(java.lang.String key)Adds the specified annotation.DefaultAnnotations.Builderset(java.lang.String key, java.lang.String value)Adds the specified annotation.
-
-
-
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(java.util.Map<java.lang.String,java.lang.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(java.lang.String key, java.lang.String value)
Adds the specified annotation. Any previous value associated with the given annotation key will be overwritten.- Parameters:
key- annotation keyvalue- annotation value- Returns:
- self
-
remove
public DefaultAnnotations.Builder remove(java.lang.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
-
-