Interface AttributesBuilder
-
- All Known Implementing Classes:
ArrayBackedAttributesBuilder
public interface AttributesBuilderA builder ofAttributessupporting an arbitrary number of key-value pairs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Attributesbuild()Create theAttributesfrom this.<T> AttributesBuilderput(AttributeKey<java.lang.Long> key, int value)Puts aAttributeKeywith associated value into this.default <T> AttributesBuilderput(AttributeKey<java.util.List<T>> key, T... value)Puts a List attribute into this.<T> AttributesBuilderput(AttributeKey<T> key, T value)Puts aAttributeKeywith associated value into this.default AttributesBuilderput(java.lang.String key, boolean value)Puts a boolean attribute into this.default AttributesBuilderput(java.lang.String key, boolean... value)Puts a Boolean array attribute into this.default AttributesBuilderput(java.lang.String key, double value)Puts a double attribute into this.default AttributesBuilderput(java.lang.String key, double... value)Puts a Double array attribute into this.default AttributesBuilderput(java.lang.String key, long value)Puts a long attribute into this.default AttributesBuilderput(java.lang.String key, long... value)Puts a Long array attribute into this.default AttributesBuilderput(java.lang.String key, java.lang.String value)Puts a String attribute into this.default AttributesBuilderput(java.lang.String key, java.lang.String... value)Puts a String array attribute into this.AttributesBuilderputAll(Attributes attributes)Puts all the provided attributes into this Builder.default <T> AttributesBuilderremove(AttributeKey<T> key)default AttributesBuilderremoveIf(java.util.function.Predicate<AttributeKey<?>> filter)Remove all attributes that satisfy the given predicate.
-
-
-
Method Detail
-
build
Attributes build()
Create theAttributesfrom this.
-
put
<T> AttributesBuilder put(AttributeKey<java.lang.Long> key, int value)
Puts aAttributeKeywith associated value into this.The type parameter is unused.
-
put
<T> AttributesBuilder put(AttributeKey<T> key, T value)
Puts aAttributeKeywith associated value into this.
-
put
default AttributesBuilder put(java.lang.String key, java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String key, java.lang.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 <T> AttributesBuilder put(AttributeKey<java.util.List<T>> key, T... value)
Puts a List attribute into this.- Returns:
- this Builder
-
put
default AttributesBuilder put(java.lang.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(java.lang.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(java.lang.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
-
remove
default <T> AttributesBuilder remove(AttributeKey<T> key)
- Returns:
- this Builder
-
removeIf
default AttributesBuilder removeIf(java.util.function.Predicate<AttributeKey<?>> filter)
Remove all attributes that satisfy the given predicate. Errors or runtime exceptions thrown by the predicate are relayed to the caller.- Returns:
- this Builder
-
-