public final class Context extends Object
| Constructor and Description |
|---|
Context()
Create new object.
|
Context(Context context)
Create new object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyValueTo(String name,
Context context)
Copy the value to the specified context.
|
void |
copyValueTo(String name,
Context context,
String contextName)
Copy the value to the specified context.
|
List<String> |
getNames()
Get all context names.
|
<T> T |
getValue(String name)
Get the value from the context.
|
boolean |
hasValue(String name)
Check if the context has the value.
|
<T> void |
putValue(String name,
T value)
Put the value to the context.
|
void |
removeValue(String name)
Remove the value from the context.
|
String |
toString() |
public Context()
public Context(Context context)
context - the parent context.public boolean hasValue(String name)
name - the specified name.public <T> T getValue(String name)
T - the generic type of the value.name - the specified name.public <T> void putValue(String name, T value)
T - the generic type of the value.name - the specified name.value - the value to put to the context.public void removeValue(String name)
name - the specified name.public void copyValueTo(String name, Context context)
name - the specified name to get the value from this context and to put the value to the specified context.context - the specified context.public void copyValueTo(String name, Context context, String contextName)
name - the specified name to get the value from this context.context - the specified context.contextName - the specified name to put the value to the specified context.Copyright © 2019. All rights reserved.