Interface AttributesBuilder
Attributes supporting an arbitrary number of key-value pairs.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Create theAttributesfrom this.put(AttributeKey<Long> key, int value) Puts aAttributeKeywith associated value into this.put(AttributeKey<T> key, T value) Puts aAttributeKeywith associated value into this.default AttributesBuilderPuts a boolean attribute into this.default AttributesBuilderPuts a Boolean array attribute into this.default AttributesBuilderPuts a double attribute into this.default AttributesBuilderPuts a Double array attribute into this.default AttributesBuilderPuts a long attribute into this.default AttributesBuilderPuts a Long array attribute into this.default AttributesBuilderPuts a String attribute into this.default AttributesBuilderPuts a String array attribute into this.putAll(Attributes attributes) Puts all the provided attributes into this Builder.default <T> AttributesBuilderremove(AttributeKey<T> key) default AttributesBuilderremoveIf(Predicate<AttributeKey<?>> filter) Remove all attributes that satisfy the given predicate.
-
Method Details
-
build
Attributes build()Create theAttributesfrom this. -
put
Puts aAttributeKeywith associated value into this.The type parameter is unused.
-
put
Puts aAttributeKeywith associated value into this. -
put
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
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
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
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
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
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
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
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
Puts all the provided attributes into this Builder.- Returns:
- this Builder
-
remove
- Returns:
- this Builder
-
removeIf
Remove all attributes that satisfy the given predicate. Errors or runtime exceptions thrown by the predicate are relayed to the caller.- Returns:
- this Builder
-