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.
| Access | Constructor and Description |
|---|---|
| public | |
| public | ConcurrentModel(String attributeName, Object attributeValue)
Construct a new |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ConcurrentModel | addAllAttributes(Collection<?> attributeValues)
Implements org. Copy all attributes in the supplied |
| public ConcurrentModel | addAllAttributes(Map<String, ?> attributes)
Implements org. Copy all attributes in the supplied |
| public ConcurrentModel | addAttribute(String
the name of the model attribute (never attributeName, Object null)the model attribute value (ignored if attributeValue)null,
just removing an existing entry if any)Implements org. Add the supplied attribute under the supplied name. |
| public ConcurrentModel | addAttribute(Object
the model attribute value (never attributeValue)null)Implements org. Add the supplied attribute to this |
| public Map | asMap()
Implements org. Return the current set of model attributes as a Map. |
| public boolean | Returns: whether this model contains a corresponding attributethe name of the model attribute (never attributeName)null)Implements org. Does this model contain an attribute of the given name? |
| public Object | getAttribute(String
the name of the model attribute (never attributeName)null)Implements org. Return the attribute value for the given name, if any. |
| public ConcurrentModel | mergeAttributes(Map<String, ?> attributes)
Implements org. Copy all attributes in the supplied |
| public Object | put(String
key with which the specified value is to be associated key, Object value to be associated with the specified key value)Overrides java. Implements java. Maps the specified key to the specified value in this table. |
| public void | putAll(Map<? extends String, ?>
mappings to be stored in this map map)Overrides java. Implements java. Copies all of the mappings from the specified map to this one. |
| ConcurrentModel | back to summary |
|---|---|
| public ConcurrentModel() Construct a new, empty | |
| ConcurrentModel | back to summary |
|---|---|
| public ConcurrentModel(String attributeName, Object attributeValue) Construct a new
| |
| ConcurrentModel | back to summary |
|---|---|
| public ConcurrentModel(Object attributeValue) Construct a new
| |
| addAllAttributes | back to summary |
|---|---|
| public ConcurrentModel addAllAttributes(Collection<?> attributeValues) Implements org. Copy all attributes in the supplied
| |
| addAllAttributes | back to summary |
|---|---|
| public ConcurrentModel addAllAttributes(Map<String, ?> attributes) Implements org. Copy all attributes in the supplied
| |
| addAttribute | back to summary |
|---|---|
| public ConcurrentModel addAttribute(String attributeName, Object attributeValue) Implements org. Add the supplied attribute under the supplied name. | |
| addAttribute | back to summary |
|---|---|
| public ConcurrentModel addAttribute(Object attributeValue) Implements org. Add the supplied attribute to this Note Empty | |
| asMap | back to summary |
|---|---|
| public Map Implements org. Doc from org. Return the current set of model attributes as a Map.
| |
| containsAttribute | back to summary |
|---|---|
| public boolean containsAttribute(String attributeName) Implements org. Does this model contain an attribute of the given name? | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String attributeName) Implements org. Doc from org. Return the attribute value for the given name, if any. | |
| mergeAttributes | back to summary |
|---|---|
| public ConcurrentModel mergeAttributes(Map<String, ?> attributes) Implements org. Copy all attributes in the supplied
| |
| put | back to summary |
|---|---|
| public Object put(String key, Object value) Overrides java. Implements java. Doc from java. Maps the specified key to the specified value in this table. Neither the key nor the value can be null. The value can be retrieved by calling the | |
| putAll | back to summary |
|---|---|
| public void putAll(Map<? extends String, ?> map) Overrides java. Implements java. Doc from java. Copies all of the mappings from the specified map to this one. These mappings replace any mappings that this map had for any of the keys currently in the specified map. | |