@ApiAudience.Private @ApiStability.Unstable public final class ContextConc extends java.lang.Object implements Context
Modifier and Type | Field and Description |
---|---|
protected ChainIdHash |
chainIdHash |
protected Configuration |
configuration |
protected org.slf4j.Logger |
logger |
protected Context |
parent |
protected java.lang.String |
scope |
protected java.util.Set<Strategy> |
strategies |
Modifier | Constructor and Description |
---|---|
protected |
ContextConc(Context parent,
java.lang.String scope,
ChainIdHash chainIdHash,
Configuration configuration,
java.util.Set<Strategy> strageties) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
protected Context |
getScopeBase() |
protected Context |
getScopeParent() |
java.util.Set<Strategy> |
getStrategies()
Get a strategies of a context.
|
<StrategyT extends Strategy> |
getStrategy(java.lang.Class<StrategyT> strategyClass)
Get a strategy whose matches type
strategyClass from a context. |
int |
hashCode() |
protected boolean |
isScopeBase() |
Context |
popScope()
Get a context instance without current scope.
|
Context |
withChainIdHash(ChainIdHash chainIdHash)
Make a context instance with
chainIdHash . |
Context |
withConfiguration(Configuration configuration)
Make a context instance with corresponding
configuration . |
Context |
withKeyValue(java.lang.String key,
java.lang.Object value)
Make a context instance with corresponding
key and a value . |
Context |
withoutKey(java.lang.String key)
Get a context instance without configuration matching
key . |
<StrategyT extends Strategy> |
withoutStrategy(java.lang.Class<StrategyT> strategy)
Remove strategy from the context.
|
Context |
withScope(java.lang.String scope)
Make a context instance with
scope . |
Context |
withStrategies(java.util.Set<Strategy> strategies)
Make a context instance with corresponding
strategies . |
<StrategyT extends Strategy> |
withStrategy(StrategyT strategy)
Make a context instance with corresponding
strategy . |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getChainIdHash, getConfiguration, getScope
protected final org.slf4j.Logger logger
protected final Context parent
protected final java.lang.String scope
protected final ChainIdHash chainIdHash
protected final Configuration configuration
protected final java.util.Set<Strategy> strategies
protected ContextConc(Context parent, java.lang.String scope, ChainIdHash chainIdHash, Configuration configuration, java.util.Set<Strategy> strageties)
public Context withScope(java.lang.String scope)
Context
scope
.public Context popScope()
Context
public Context withChainIdHash(ChainIdHash chainIdHash)
Context
chainIdHash
.withChainIdHash
in interface Context
chainIdHash
- a chain id hashchainIdHash
protected Context getScopeBase()
protected Context getScopeParent()
protected boolean isScopeBase()
public Context withKeyValue(java.lang.String key, java.lang.Object value)
Context
key
and a value
.withKeyValue
in interface Context
key
- a keyvalue
- a valuepublic Context withConfiguration(Configuration configuration)
Context
configuration
.withConfiguration
in interface Context
configuration
- a configurationconfiguration
public Context withoutKey(java.lang.String key)
Context
key
.withoutKey
in interface Context
key
- a keypublic <StrategyT extends Strategy> Context withStrategy(StrategyT strategy)
Context
strategy
.withStrategy
in interface Context
StrategyT
- strategy typestrategy
- a strategyStrategy
public Context withStrategies(java.util.Set<Strategy> strategies)
Context
strategies
.withStrategies
in interface Context
strategies
- new strategiesstrategies
public <StrategyT extends Strategy> StrategyT getStrategy(java.lang.Class<StrategyT> strategyClass)
Context
strategyClass
from a context.getStrategy
in interface Context
StrategyT
- strategy typestrategyClass
- a strategy classstrategyClass
. Otherwise, nullpublic <StrategyT extends Strategy> Context withoutStrategy(java.lang.Class<StrategyT> strategy)
Context
withoutStrategy
in interface Context
StrategyT
- strategy typestrategy
- strategy to removeStrategy
public java.util.Set<Strategy> getStrategies()
Context
getStrategies
in interface Context
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object