Package cn.sliew.milky.common.chain
Interface Context<K,V>
-
- All Superinterfaces:
Map<K,V>
- All Known Implementing Classes:
ContextMap
public interface Context<K,V> extends Map<K,V>
执行上下文,用来在不同的Command间传递信息。 Map后面可以考虑使用AttributeMap代替。
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Loggerlogger()This method provider aLoggerutililies for user can't construct a logger or try to log pipeline context message to one logger file.<T extends V>
Tretrieve(K key)That method enhances theMap.get(Object)method that helps users avoid the redundant code of type cast/checking when assignments are already known.-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
retrieve
<T extends V> T retrieve(K key)
That method enhances theMap.get(Object)method that helps users avoid the redundant code of type cast/checking when assignments are already known.It throws
ClassCastExceptionif types are not assignable.- Type Parameters:
T- the target assignment type- Parameters:
key- the key whose associated value is to be returned- Returns:
- the value to which the specified key is mapped,
or
nullif this map contains no mapping for the key - See Also:
Map.get(Object)
-
logger
Logger logger()
This method provider aLoggerutililies for user can't construct a logger or try to log pipeline context message to one logger file.- Returns:
- logger
-
-