Package com.linecorp.armeria.common
Interface Attributes
- All Superinterfaces:
AttributesGetters
An immutable
Attributes
that holds attributes which can be accessed via AttributeKey
.-
Method Summary
Modifier and TypeMethodDescriptionstatic AttributesBuilder
builder()
Returns a new emptyAttributesBuilder
.static AttributesBuilder
builder
(AttributesGetters parent) Returns a new emptyAttributesBuilder
.static Attributes
fromParent
(AttributesGetters parent) Returns a newAttributes
with the specified parentAttributesGetters
.static Attributes
of()
Returns an emptyAttributes
.static <T> Attributes
of
(AttributeKey<T> key, T value) static <T,
U> Attributes of
(AttributeKey<T> k1, T v1, AttributeKey<U> k2, U v2) static <T,
U, V> Attributes of
(AttributeKey<T> k1, T v1, AttributeKey<U> k2, U v2, AttributeKey<V> k3, V v3) static <T,
U, V, W> Attributes of
(AttributeKey<T> k1, T v1, AttributeKey<U> k2, U v2, AttributeKey<V> k3, V v3, AttributeKey<W> k4, W v4) Returns a new builder created from the entries of thisAttributes
.Converts thisAttributes
into aConcurrentAttributes
.default Attributes
withMutations
(Consumer<AttributesBuilder> mutator) Returns a newAttributes
which is the result from the mutation by the specifiedConsumer
.Methods inherited from interface com.linecorp.armeria.common.AttributesGetters
attr, attrs, hasAttr, hasOwnAttr, isEmpty, ownAttr, ownAttrs, parent, size
-
Method Details
-
of
Returns an emptyAttributes
. -
of
-
of
-
of
static <T,U, Attributes ofV> (AttributeKey<T> k1, T v1, AttributeKey<U> k2, U v2, AttributeKey<V> k3, V v3) -
of
static <T,U, Attributes ofV, W> (AttributeKey<T> k1, T v1, AttributeKey<U> k2, U v2, AttributeKey<V> k3, V v3, AttributeKey<W> k4, W v4) -
fromParent
Returns a newAttributes
with the specified parentAttributesGetters
. The parentAttributesGetters
can be accessed viaAttributesGetters.attr(AttributeKey)
orAttributesGetters.attrs()
. -
builder
Returns a new emptyAttributesBuilder
. -
builder
Returns a new emptyAttributesBuilder
. The parentAttributes
can be accessed viaAttributesGetters.attr(AttributeKey)
orAttributesGetters.attrs()
.Note that any mutations in
AttributesBuilder
won't modify the attributes in the parent. -
withMutations
Returns a newAttributes
which is the result from the mutation by the specifiedConsumer
. This method is a shortcut for:builder = toBuilder(); mutator.accept(builder); return builder.build();
- See Also:
-
toConcurrentAttributes
ConcurrentAttributes toConcurrentAttributes()Converts thisAttributes
into aConcurrentAttributes
. -
toBuilder
AttributesBuilder toBuilder()Returns a new builder created from the entries of thisAttributes
.
-