public class BaseComponentContext<C extends ComponentContext<C>> extends LinkedHashMap<Object,Object> implements ComponentContext<C>
ComponentContext
.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
BaseComponentContext() |
Modifier and Type | Method and Description |
---|---|
Object |
get(Object key)
Gets a value from a context.
|
<T> T |
get(Object key,
Class<T> type)
Gets a value from a context with a given type to get cast to.
|
ComponentContext<C> |
put(Object key,
Object value)
Put an entry into a context.
|
Stream<Map.Entry<Object,Object>> |
stream()
Stream key/value pairs from this
ComponentContext |
Map<String,Object> |
toTemplateModel()
Gets context values as a map.
|
clear, containsValue, entrySet, forEach, getOrDefault, keySet, removeEldestEntry, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsKey, empty
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, size
public Object get(Object key)
ComponentContext
get
in interface Map<Object,Object>
get
in interface ComponentContext<C extends ComponentContext<C>>
get
in class LinkedHashMap<Object,Object>
key
- the keypublic <T> T get(Object key, Class<T> type)
ComponentContext
get
in interface ComponentContext<C extends ComponentContext<C>>
T
- the type of contextkey
- the keytype
- the class typepublic ComponentContext<C> put(Object key, Object value)
ComponentContext
public Stream<Map.Entry<Object,Object>> stream()
ComponentContext
ComponentContext
stream
in interface ComponentContext<C extends ComponentContext<C>>
Stream
of key/value pairs held by this contextpublic Map<String,Object> toTemplateModel()
ComponentContext
toTemplateModel
in interface ComponentContext<C extends ComponentContext<C>>
Copyright © 2024. All rights reserved.