Interface MutableAttributeHolder
- All Superinterfaces:
AttributeHolder
- All Known Subinterfaces:
ApplicationContext, BeanContext, ByteBodyHttpResponse<B>, ConfigurableApplicationContext, ConfigurableBeanContext, ConstructorInvocationContext<T>, FormCapableHttpRequest<B>, FullHttpRequest<B>, HttpMessage<B>, HttpRequest<B>, HttpResponse<B>, InvocationContext<T,R>, LifecycleHttpRequest<B>, MethodInvocationContext<T, R>, MutableHttpMessage<B>, MutableHttpRequest<B>, MutableHttpResponse<B>, PushCapableHttpRequest<B>, ServerHttpRequest<B>
- All Known Implementing Classes:
AbstractNettyHttpRequest, ByteBodyHttpResponseWrapper, ConstructorInterceptorChain, DefaultBeanContext, FullNettyClientHttpResponse, HttpMessageWrapper, HttpRequestWrapper, HttpResponseAdapter, HttpResponseWrapper, InterceptorChain, MethodInterceptorChain, MutableHttpRequestWrapper, NettyClientHttpRequest, NettyHttpRequest, NettyMutableHttpResponse, SimpleHttpRequest
An interface for types that support mutating attributes.
- Since:
- 1.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionOverrides the defaultAttributeHolder.getAttributes()method to return a mutable object.default <T> Optional<T> removeAttribute(CharSequence name, Class<T> type) Remove an attribute.default MutableAttributeHoldersetAttribute(CharSequence name, @Nullable Object value) Sets an attribute on the message.Methods inherited from interface AttributeHolder
getAttribute, getAttribute
-
Method Details
-
getAttributes
MutableConvertibleValues<Object> getAttributes()Overrides the defaultAttributeHolder.getAttributes()method to return a mutable object.- Specified by:
getAttributesin interfaceAttributeHolder- Returns:
- The mutable attributes
-
setAttribute
Sets an attribute on the message.- Parameters:
name- The name of the attributevalue- The value of the attribute- Returns:
- This message
-
removeAttribute
Remove an attribute. Returning the old value if it is present.- Type Parameters:
T- type Generic- Parameters:
name- The name of the attributetype- The required type- Returns:
- An
Optionalvalue
-