public class DefaultContext extends AbstractContext
Modifier and Type | Field and Description |
---|---|
protected static String |
ERROR_KEY_BLANK |
parentContext
Constructor and Description |
---|
DefaultContext() |
DefaultContext(Context parentContext) |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys this context.
|
protected Object |
doGet(String key) |
boolean |
hasKey(String key)
Searches for the key in this context only.
|
Set<String> |
keySet()
Returns a
Set view of the keys contained in this context. |
void |
put(String key,
Object value)
Sets a key/value pair on this context.
|
void |
putAt(String key,
Object value)
Sets a key/value pair on this context.
|
Object |
remove(String key)
Removes a key from this context.
|
<T> T |
removeAs(String key)
Removes a key from this context.
|
<T> T |
removeConverted(String key,
Class<T> type)
Removes a key from this context.
|
containsKey, convertValue, get, get, getAs, getAs, getAsBoolean, getAsBoolean, getAsDouble, getAsDouble, getAsFloat, getAsFloat, getAsInt, getAsInt, getAsLong, getAsLong, getAsString, getAsString, getAt, getAt, getConverted, getConverted, getParentContext, injectMembers
protected static final String ERROR_KEY_BLANK
@Nullable protected Object doGet(@Nonnull String key)
doGet
in class AbstractContext
public boolean hasKey(@Nonnull String key)
Context
key
- the key to search@Nullable public Object remove(@Nonnull String key)
Context
key
- the key to be removed@Nullable public <T> T removeAs(@Nonnull String key)
Context
key
- the key to be removed@Nullable public <T> T removeConverted(@Nonnull String key, @Nonnull Class<T> type)
Context
PropertyEditor
.key
- the key to be removedtype
- the type to be returnedpublic void put(@Nonnull String key, @Nullable Object value)
Context
key
- the key to be registeredvalue
- the value to savepublic void putAt(@Nonnull String key, @Nullable Object value)
Context
key
- the key to be registeredvalue
- the value to savepublic void destroy()
Context
destroy
in interface Context
destroy
in class AbstractContext