public static class Attributes.Builder extends Object
Attributes instance with an arbitrary number of key-value
pairs.| Modifier and Type | Method and Description |
|---|---|
Attributes.Builder |
addAll(Attributes attributes)
Add all the provided attributes to this Builder.
|
Attributes |
build()
Create the
Attributes from this. |
<T> Attributes.Builder |
setAttribute(AttributeKey<Long> key,
int value)
Sets a
AttributeKey with associated value into this. |
<T> Attributes.Builder |
setAttribute(AttributeKey<T> key,
T value)
Sets a
AttributeKey with associated value into this. |
Attributes.Builder |
setAttribute(String key,
Boolean... value)
Sets a Boolean array attribute into this.
|
Attributes.Builder |
setAttribute(String key,
boolean value)
Sets a boolean attribute into this.
|
Attributes.Builder |
setAttribute(String key,
Double... value)
Sets a Double array attribute into this.
|
Attributes.Builder |
setAttribute(String key,
double value)
Sets a double attribute into this.
|
Attributes.Builder |
setAttribute(String key,
Long... value)
Sets a Long array attribute into this.
|
Attributes.Builder |
setAttribute(String key,
long value)
Sets a long attribute into this.
|
Attributes.Builder |
setAttribute(String key,
String... value)
Sets a String array attribute into this.
|
Attributes.Builder |
setAttribute(String key,
String value)
Sets a String attribute into this.
|
public Attributes build()
Attributes from this.public <T> Attributes.Builder setAttribute(AttributeKey<Long> key, int value)
AttributeKey with associated value into this.public <T> Attributes.Builder setAttribute(AttributeKey<T> key, T value)
AttributeKey with associated value into this.public Attributes.Builder setAttribute(String key, String value)
Note: It is strongly recommended to use setAttribute(AttributeKey, Object), and
pre-allocate your keys, if possible.
public Attributes.Builder setAttribute(String key, long value)
Note: It is strongly recommended to use setAttribute(AttributeKey, Object), and
pre-allocate your keys, if possible.
public Attributes.Builder setAttribute(String key, double value)
Note: It is strongly recommended to use setAttribute(AttributeKey, Object), and
pre-allocate your keys, if possible.
public Attributes.Builder setAttribute(String key, boolean value)
Note: It is strongly recommended to use setAttribute(AttributeKey, Object), and
pre-allocate your keys, if possible.
public Attributes.Builder setAttribute(String key, String... value)
Note: It is strongly recommended to use setAttribute(AttributeKey, Object), and
pre-allocate your keys, if possible.
public Attributes.Builder setAttribute(String key, Long... value)
Note: It is strongly recommended to use setAttribute(AttributeKey, Object), and
pre-allocate your keys, if possible.
public Attributes.Builder setAttribute(String key, Double... value)
Note: It is strongly recommended to use setAttribute(AttributeKey, Object), and
pre-allocate your keys, if possible.
public Attributes.Builder setAttribute(String key, Boolean... value)
Note: It is strongly recommended to use setAttribute(AttributeKey, Object), and
pre-allocate your keys, if possible.
public Attributes.Builder addAll(Attributes attributes)