| 限定符和类型 | 字段和说明 |
|---|---|
private Block |
block
新作用域的block
|
private Context |
context
被包装的context
|
private @Nullable KeyMapper |
mapper
参数映射器
|
private @Nullable Set<Key<?>> |
readableKeys
可读key
|
private @Nullable Set<Key<?>> |
writableKeys
可写key
|
| 构造器和说明 |
|---|
ContextWrapper(@NotNull Context context,
@NotNull Block block) |
ContextWrapper(@NotNull Context context,
@NotNull Block block,
@Nullable KeyManager keyManager) |
ContextWrapper(@NotNull Context context,
@NotNull Block block,
@Nullable KeyMapper mapper,
@Nullable Set<Key<?>> readableKeys,
@Nullable Set<Key<?>> writableKeys) |
| 限定符和类型 | 方法和说明 |
|---|---|
Context |
cloneContext()
克隆流程上下文,新建流程上下文,并复制当前上下文中的参数至新的上下文对象。
|
boolean |
containsKey(@NotNull Key<?> key)
是否有指定映射
|
private boolean |
containsKey(@NotNull Key<?> key,
boolean keyCheck,
boolean keyMapping) |
boolean |
containsValue(@NotNull Object value)
返回是否有指定的值。
|
<V> V |
get(@NotNull Key<V> key)
获取指定类型的值。
|
protected <V> V |
get(@NotNull Key<V> key,
boolean keyCheck,
boolean keyMapping) |
<V> V |
get(@NotNull Key<V> key,
V defaultValue)
获取指定key的值,如果为null,则取默认值。
|
private <V> V |
get(@NotNull Key<V> key,
V defaultValue,
boolean keyCheck,
boolean keyMapping) |
Block |
getBlock()
获取当前区块
|
Throwable |
getCurrentException()
获取当前异常对象
|
KeyMapper |
getMapper()
获取参数映射器
|
@NotNull Map<Key<?>,Object> |
getParameters()
获取所有的参数Key,返回结果不可修改
|
boolean |
isEmpty()
如果当前map没有映射时,返回true,否则返回false。
|
<V> V |
put(@NotNull Key<V> key,
V value)
添加键值映射
|
private <V> V |
put(@NotNull Key<V> key,
V value,
boolean keyCheck,
boolean keyMapping) |
void |
putAll(@NotNull Map<? extends Key<?>,?> params)
将params中的所有映射添加至当前map。
|
private void |
putAll(@NotNull Map<? extends Key<?>,?> params,
boolean keyCheck,
boolean keyMapping) |
<V> V |
putIfAbsent(@NotNull Key<V> key,
V value)
如果当前key对应的value不存在,添加映射,否则不添加。
|
private <V> V |
putIfAbsent(@NotNull Key<V> key,
V value,
boolean keyCheck,
boolean keyMapping) |
boolean |
readableKey(Key<?> key)
当前key是否可读。
|
<V> V |
remove(@NotNull Key<V> key)
删除指定键的映射关系。
|
private <V> V |
remove(Key<V> key,
boolean keyCheck,
boolean keyMapping) |
void |
setCurrentException(Throwable t)
设置当前异常对象
|
int |
size()
获取当前参数映射的大小。
|
boolean |
writableKey(Key<?> key)
当前key是否可写。
|
private Context context
private Block block
@Nullable private @Nullable KeyMapper mapper
public ContextWrapper(@NotNull
@NotNull Context context,
@NotNull
@NotNull Block block)
public ContextWrapper(@NotNull
@NotNull Context context,
@NotNull
@NotNull Block block,
@Nullable
@Nullable KeyManager keyManager)
public Context cloneContext()
ContextcloneContext 在接口中 Context@Nullable
public <V> V put(@NotNull
@NotNull Key<V> key,
@NotNull
V value)
Parameterput 在接口中 ParameterV - 值类型key - 与指定值关联的键value - 与指定键关联的值Map.put(Object, Object)@Nullable
private <V> V put(@NotNull
@NotNull Key<V> key,
V value,
boolean keyCheck,
boolean keyMapping)
@Nullable
public <V> V putIfAbsent(@NotNull
@NotNull Key<V> key,
@NotNull
V value)
ParameterputIfAbsent 在接口中 ParameterV - 值类型key - 与指定值关联的键value - 与指定键关联的值Map.putIfAbsent(Object, Object)@Nullable
private <V> V putIfAbsent(@NotNull
@NotNull Key<V> key,
@NotNull
V value,
boolean keyCheck,
boolean keyMapping)
@Nullable
public <V> V get(@NotNull
@NotNull Key<V> key)
Parameterget 在接口中 ParameterV - 返回值类型key - 与指定值关联的键Map.get(Object)@Nullable
protected <V> V get(@NotNull
@NotNull Key<V> key,
boolean keyCheck,
boolean keyMapping)
public <V> V get(@NotNull
@NotNull Key<V> key,
V defaultValue)
Parameterget 在接口中 ParameterV - 返回值类型key - 与指定值关联的键defaultValue - 与指定键关联的值如果不存在,返回的默认值Map.getOrDefault(Object, Object)@NotNull public @NotNull Map<Key<?>,Object> getParameters()
ParametergetParameters 在接口中 ParameterCollections.unmodifiableMap(Map),
KeyMapperprivate <V> V get(@NotNull
@NotNull Key<V> key,
V defaultValue,
boolean keyCheck,
boolean keyMapping)
public int size()
Parametersize 在接口中 ParameterMap.size()public boolean isEmpty()
ParameterisEmpty 在接口中 ParameterMap.isEmpty()public boolean containsKey(@NotNull
@NotNull Key<?> key)
ParametercontainsKey 在接口中 Parameterkey - 与指定值关联的键Map.containsKey(Object)private boolean containsKey(@NotNull
@NotNull Key<?> key,
boolean keyCheck,
boolean keyMapping)
public boolean containsValue(@NotNull
@NotNull Object value)
ParametercontainsValue 在接口中 Parametervalue - 与指定值关联的键Map.containsValue(Object)@Nullable
public <V> V remove(@NotNull
@NotNull Key<V> key)
Parameterremove 在接口中 ParameterV - 值类型key - 与指定值关联的键Map.remove(Object)@Nullable private <V> V remove(Key<V> key, boolean keyCheck, boolean keyMapping)
public void putAll(@NotNull
@NotNull Map<? extends Key<?>,?> params)
ParameterputAll 在接口中 Parameterparams - 参数mapMap.putAll(Map)private void putAll(@NotNull
@NotNull Map<? extends Key<?>,?> params,
boolean keyCheck,
boolean keyMapping)
public boolean readableKey(Key<?> key)
ContextreadableKey 在接口中 Contextkey - 参数keypublic boolean writableKey(Key<?> key)
ContextwritableKey 在接口中 Contextkey - 参数keypublic Throwable getCurrentException()
ContextgetCurrentException 在接口中 Contextpublic void setCurrentException(Throwable t)
ContextsetCurrentException 在接口中 Contextt - 当前异常对象Copyright © 2021. All rights reserved.