public class DelegatingHasContextAndHeaders extends Object implements HasContextAndHeaders
Constructor and Description |
---|
DelegatingHasContextAndHeaders(HasContextAndHeaders delegate) |
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
|
<V> void |
putHeader(String key,
V value) |
<V> V |
putInContext(Object key,
Object value)
Attaches the given value to the context.
|
public DelegatingHasContextAndHeaders(HasContextAndHeaders delegate)
public <V> void putHeader(String key, V value)
putHeader
in interface HasHeaders
public void copyContextAndHeadersFrom(HasContextAndHeaders other)
HasContextAndHeaders
copyContextAndHeadersFrom
in interface HasContextAndHeaders
other
- another object supporting headers and contextpublic <V> V getHeader(String key)
getHeader
in interface HasHeaders
public boolean hasHeader(String key)
hasHeader
in interface HasHeaders
public <V> V putInContext(Object key, Object value)
HasContext
putInContext
in interface HasContext
null
if there was none.public Set<String> getHeaders()
getHeaders
in interface HasHeaders
public void copyHeadersFrom(HasHeaders from)
copyHeadersFrom
in interface HasHeaders
public void putAllInContext(com.carrotsearch.hppc.ObjectObjectAssociativeContainer<Object,Object> map)
HasContext
putAllInContext
in interface HasContext
public <V> V getFromContext(Object key)
getFromContext
in interface HasContext
HasContext.putInContext(Object, Object)
public <V> V getFromContext(Object key, V defaultValue)
getFromContext
in interface HasContext
defaultValue
- The default value that should be returned for the given key, if no
value is currently associated with it.HasContext.putInContext(Object, Object)
public boolean hasInContext(Object key)
HasContext
hasInContext
in interface HasContext
public int contextSize()
contextSize
in interface HasContext
public boolean isContextEmpty()
HasContext
isContextEmpty
in interface HasContext
public ImmutableOpenMap<Object,Object> getContext()
getContext
in interface HasContext
public void copyContextFrom(HasContext other)
HasContext
copyContextFrom
in interface HasContext
Copyright © 2009–2016. All rights reserved.