public class ContextAndHeaderHolder extends Object implements HasContextAndHeaders
| Constructor and Description |
|---|
ContextAndHeaderHolder() |
| Modifier and Type | Method and Description |
|---|---|
int |
contextSize() |
void |
copyContextAndHeadersFrom(HasContextAndHeaders other)
copies over the context and the headers
|
void |
copyContextFrom(HasContext other)
Copies the context from the given context holder to this context holder.
|
void |
copyHeadersFrom(HasHeaders from) |
ImmutableOpenMap<Object,Object> |
getContext() |
<V> V |
getFromContext(Object key) |
<V> V |
getFromContext(Object key,
V defaultValue) |
<V> V |
getHeader(String key) |
Set<String> |
getHeaders() |
boolean |
hasHeader(String key) |
boolean |
hasInContext(Object key)
Checks if the context contains an entry with the given key
|
boolean |
isContextEmpty()
Checks if the context is empty.
|
void |
putAllInContext(com.carrotsearch.hppc.ObjectObjectAssociativeContainer<Object,Object> map)
Attaches the given values to the context
|
void |
putHeader(String key,
Object value) |
<V> V |
putInContext(Object key,
Object value)
Attaches the given value to the context.
|
public final <V> V putInContext(Object key, Object value)
HasContextputInContext in interface HasContextnull if there was none.public final void putAllInContext(com.carrotsearch.hppc.ObjectObjectAssociativeContainer<Object,Object> map)
HasContextputAllInContext in interface HasContextpublic final <V> V getFromContext(Object key)
getFromContext in interface HasContextHasContext.putInContext(Object, Object)public final <V> V getFromContext(Object key, V defaultValue)
getFromContext in interface HasContextdefaultValue - The default value that should be returned for the given key, if no
value is currently associated with it.HasContext.putInContext(Object, Object)public final boolean hasInContext(Object key)
HasContexthasInContext in interface HasContextpublic final int contextSize()
contextSize in interface HasContextpublic final boolean isContextEmpty()
HasContextisContextEmpty in interface HasContextpublic ImmutableOpenMap<Object,Object> getContext()
getContext in interface HasContextpublic void copyContextFrom(HasContext other)
HasContextcopyContextFrom in interface HasContextpublic final void putHeader(String key, Object value)
putHeader in interface HasHeaderspublic final <V> V getHeader(String key)
getHeader in interface HasHeaderspublic final boolean hasHeader(String key)
hasHeader in interface HasHeaderspublic Set<String> getHeaders()
getHeaders in interface HasHeaderspublic void copyHeadersFrom(HasHeaders from)
copyHeadersFrom in interface HasHeaderspublic void copyContextAndHeadersFrom(HasContextAndHeaders other)
HasContextAndHeaderscopyContextAndHeadersFrom in interface HasContextAndHeadersother - another object supporting headers and contextCopyright © 2009–2017. All rights reserved.