public class ContextHolder extends Object
Constructor and Description |
---|
ContextHolder() |
Modifier and Type | Method and Description |
---|---|
int |
contextSize() |
void |
copyContextFrom(ContextHolder other)
Copies the context from the given context holder to this context holder.
|
ImmutableOpenMap<Object,Object> |
getContext() |
<V> V |
getFromContext(Object key) |
<V> V |
getFromContext(Object key,
V defaultValue) |
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> V |
putInContext(Object key,
Object value)
Attaches the given value to the context.
|
public final <V> V putInContext(Object key, Object value)
null
if there was none.public final void putAllInContext(com.carrotsearch.hppc.ObjectObjectAssociativeContainer<Object,Object> map)
public final <V> V getFromContext(Object key)
putInContext(Object, Object)
public final <V> V getFromContext(Object key, V defaultValue)
defaultValue
- The default value that should be returned for the given key, if no
value is currently associated with it.putInContext(Object, Object)
public final boolean hasInContext(Object key)
public final int contextSize()
public final boolean isContextEmpty()
public ImmutableOpenMap<Object,Object> getContext()
public void copyContextFrom(ContextHolder other)
Copyright © 2009–2015. All rights reserved.