@ApiAudience.Public @ApiStability.Unstable public class EmptyContext extends java.lang.Object implements Context
Modifier and Type | Field and Description |
---|---|
protected ChainIdHash |
chainIdHash |
protected Configuration |
configuration |
protected static Context |
emptyContext |
protected org.slf4j.Logger |
logger |
protected java.lang.String |
scope |
static java.lang.String |
SCOPE |
protected java.util.Set<Strategy> |
strategies |
Constructor and Description |
---|
EmptyContext() |
Modifier and Type | Method and Description |
---|---|
static Context |
getInstance() |
<StrategyT extends Strategy> |
getStrategy(java.lang.Class<StrategyT> strategyClass)
Get a strategy whose matches type
strategyClass from a context. |
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChainIdHash, getConfiguration, getScope, getStrategies
public static final java.lang.String SCOPE
protected static final Context emptyContext
protected final org.slf4j.Logger logger
protected final java.lang.String scope
protected final ChainIdHash chainIdHash
protected final Configuration configuration
protected final java.util.Set<Strategy> strategies
public static Context getInstance()
public Context withChainIdHash(ChainIdHash chainIdHash)
Context
chainIdHash
.withChainIdHash
in interface Context
chainIdHash
- a chain id hashchainIdHash
public Context withScope(java.lang.String scope)
Context
scope
.public Context popScope()
Context
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