Interface AttributesBuilder
-
public interface AttributesBuilder
A builder ofAttributes
supporting an arbitrary number of key-value pairs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Attributes
build()
Create theAttributes
from this.<T> AttributesBuilder
put(AttributeKey<Long> key, int value)
Puts aAttributeKey
with associated value into this.<T> AttributesBuilder
put(AttributeKey<T> key, T value)
Puts aAttributeKey
with associated value into this.default AttributesBuilder
put(String key, boolean value)
Puts a boolean attribute into this.default AttributesBuilder
put(String key, boolean... value)
Puts a Boolean array attribute into this.default AttributesBuilder
put(String key, double value)
Puts a double attribute into this.default AttributesBuilder
put(String key, double... value)
Puts a Double array attribute into this.default AttributesBuilder
put(String key, long value)
Puts a long attribute into this.default AttributesBuilder
put(String key, long... value)
Puts a Long array attribute into this.default AttributesBuilder
put(String key, String value)
Puts a String attribute into this.default AttributesBuilder
put(String key, String... value)
Puts a String array attribute into this.AttributesBuilder
putAll(Attributes attributes)
Puts all the provided attributes into this Builder.
-
-
-
Method Detail
-
build
Attributes build()
Create theAttributes
from this.
-
put
<T> AttributesBuilder put(AttributeKey<Long> key, int value)
Puts aAttributeKey
with associated value into this.
-
put
<T> AttributesBuilder put(AttributeKey<T> key, T value)
Puts aAttributeKey
with associated value into this.
-
put
default AttributesBuilder put(String key, String value)
Puts a String attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
default AttributesBuilder put(String key, long value)
Puts a long attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
default AttributesBuilder put(String key, double value)
Puts a double attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
default AttributesBuilder put(String key, boolean value)
Puts a boolean attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
default AttributesBuilder put(String key, String... value)
Puts a String array attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
default AttributesBuilder put(String key, long... value)
Puts a Long array attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
default AttributesBuilder put(String key, double... value)
Puts a Double array attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
default AttributesBuilder put(String key, boolean... value)
Puts a Boolean array attribute into this.Note: It is strongly recommended to use
put(AttributeKey, Object)
, and pre-allocate your keys, if possible.- Returns:
- this Builder
-
putAll
AttributesBuilder putAll(Attributes attributes)
Puts all the provided attributes into this Builder.- Returns:
- this Builder
-
-