程序包 cn.taketoday.ui
类 ConcurrentModel
- 所有已实现的接口:
Model,Serializable,ConcurrentMap<String,,Object> Map<String,Object>
Implementation of the
Model interface based on a ConcurrentHashMap
for use in concurrent scenarios.
Exposed to handler methods by Spring WebFlux, typically via a declaration of the
Model interface. There is typically no need to create it within user code.
If necessary a handler method can return a regular java.util.Map,
likely a java.util.ConcurrentMap, for a pre-determined model.
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K extends Object,V extends Object> 从类继承的嵌套类/接口 java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
构造器概要
构造器构造器说明Construct a new, emptyConcurrentModel.ConcurrentModel(Object attributeValue) Construct a newModelMapcontaining the supplied attribute.ConcurrentModel(String attributeName, Object attributeValue) Construct a newModelMapcontaining the supplied attribute under the supplied name. -
方法概要
修饰符和类型方法说明addAllAttributes(Collection<?> attributeValues) Copy all attributes in the suppliedCollectioninto thisMap, using attribute name generation for each element.addAllAttributes(Map<String, ?> attributes) Copy all attributes in the suppliedMapinto thisMap.addAttribute(Object attributeValue) Add the supplied attribute to thisMapusing agenerated name.addAttribute(String attributeName, Object attributeValue) Add the supplied attribute under the supplied name.asMap()Convert this model to aMapReturn the names Iterator.booleancontainsAttribute(String attributeName) Does this model contain an attribute of the given name?getAttribute(String attributeName) Returns the value of the named attribute as anObject, ornullif no attribute of the given name exists.mergeAttributes(Map<String, ?> attributes) Copy all attributes in the suppliedMapinto thisMap, with existing objects of the same name taking precedence (i.e. not getting replaced).voidremoveAttribute(String name) Removes an attribute from this request.voidsetAttribute(String name, Object value) Stores an attribute in this request.从类继承的方法 java.util.concurrent.ConcurrentHashMap
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values从类继承的方法 java.util.AbstractMap
clone从接口继承的方法 cn.taketoday.ui.Model
clear, getAttributeNames, isEmpty, setAttributes
-
构造器详细资料
-
ConcurrentModel
public ConcurrentModel()Construct a new, emptyConcurrentModel. -
ConcurrentModel
Construct a newModelMapcontaining the supplied attribute under the supplied name. -
ConcurrentModel
Construct a newModelMapcontaining the supplied attribute. Uses attribute name generation to generate the key for the supplied model object.- 另请参阅:
-
-
方法详细资料
-
put
-
putAll
-
addAttribute
Add the supplied attribute under the supplied name.- 指定者:
addAttribute在接口中Model- 参数:
attributeName- the name of the model attribute (nevernull)attributeValue- the model attribute value (ignored ifnull, just removing an existing entry if any)
-
removeAttribute
从接口复制的说明:ModelRemoves an attribute from this request. This method is not generally needed as attributes only persist as long as the request is being handled.- 指定者:
removeAttribute在接口中Model- 参数:
name- aStringspecifying the name of the attribute to remove- 返回:
- the last value of the attribute, if any
-
addAttribute
Add the supplied attribute to thisMapusing agenerated name.Note: Empty
Collectionsare not added to the model when using this method because we cannot correctly determine the true convention name. View code should check fornullrather than for empty collections as is already done by JSTL tags.- 指定者:
addAttribute在接口中Model- 参数:
attributeValue- the model attribute value (nevernull)
-
addAllAttributes
Copy all attributes in the suppliedCollectioninto thisMap, using attribute name generation for each element.- 指定者:
addAllAttributes在接口中Model- 另请参阅:
-
addAllAttributes
Copy all attributes in the suppliedMapinto thisMap.- 指定者:
addAllAttributes在接口中Model- 另请参阅:
-
mergeAttributes
Copy all attributes in the suppliedMapinto thisMap, with existing objects of the same name taking precedence (i.e. not getting replaced).- 指定者:
mergeAttributes在接口中Model
-
containsAttribute
Does this model contain an attribute of the given name?- 指定者:
containsAttribute在接口中Model- 参数:
attributeName- the name of the model attribute (nevernull)- 返回:
- whether this model contains a corresponding attribute
-
getAttribute
从接口复制的说明:ModelReturns the value of the named attribute as anObject, ornullif no attribute of the given name exists.- 指定者:
getAttribute在接口中Model- 参数:
attributeName- aStringspecifying the name of the attribute- 返回:
- an
Objectcontaining the value of the attribute, ornullif the attribute does not exist
-
setAttribute
从接口复制的说明:ModelStores an attribute in this request. Attributes are reset between requests..- 指定者:
setAttribute在接口中Model- 参数:
name- aStringspecifying the name of the attributevalue- theObjectto be stored
-
asMap
从接口复制的说明:ModelConvert this model to aMap -
attributeNames
从接口复制的说明:ModelReturn the names Iterator.- 指定者:
attributeNames在接口中Model
-