Package io.grpc
Class Attributes.Builder
- java.lang.Object
-
- io.grpc.Attributes.Builder
-
- Enclosing class:
- Attributes
public static final class Attributes.Builder extends java.lang.ObjectThe helper class to build an Attributes instance.
-
-
Field Summary
Fields Modifier and Type Field Description private Attributesbaseprivate java.util.IdentityHashMap<Attributes.Key<?>,java.lang.Object>newdata
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder(Attributes base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attributesbuild()Build the attributes.private java.util.IdentityHashMap<Attributes.Key<?>,java.lang.Object>data(int size)<T> Attributes.Builderdiscard(Attributes.Key<T> key)Removes the key and associated value from the attributes.<T> Attributes.Builderset(Attributes.Key<T> key, T value)Attributes.BuildersetAll(Attributes other)
-
-
-
Field Detail
-
base
private Attributes base
-
newdata
private java.util.IdentityHashMap<Attributes.Key<?>,java.lang.Object> newdata
-
-
Constructor Detail
-
Builder
private Builder(Attributes base)
-
-
Method Detail
-
data
private java.util.IdentityHashMap<Attributes.Key<?>,java.lang.Object> data(int size)
-
set
public <T> Attributes.Builder set(Attributes.Key<T> key, T value)
-
discard
public <T> Attributes.Builder discard(Attributes.Key<T> key)
Removes the key and associated value from the attributes.- Parameters:
key- The key to remove- Returns:
- this
- Since:
- 1.22.0
-
setAll
public Attributes.Builder setAll(Attributes other)
-
build
public Attributes build()
Build the attributes.
-
-