Interface TextTemplateModel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
get(String key, com.google.common.reflect.TypeToken<T> type)
Retrieve the given model item, of the given type.<T> T
get(String key, Class<T> type)
Retrieve the given model item, of the given type.Map<String,Object>
map(String key)
<K,V>
Map<K,V>map(String key, Class<K> keyType, Class<V> valueType)
-
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
-
get
<T> T get(String key, Class<T> type)
Retrieve the given model item, of the given type.If there is no model item with the given key,
null
is returned.If the model item with the given key is assignment compatible with the given type it is returned.
If the model item is NOT assignment compatible with the given type, an
IllegalArgumentException
will be thrown.Note: generic types are completely ignored for assignment compatiblity, due to Java's type erasure.
- Type Parameters:
T
- the target type of the model item- Parameters:
key
- the model item keytype
- the target type of the model item- Returns:
- the model item
-
get
<T> T get(String key, com.google.common.reflect.TypeToken<T> type)
Retrieve the given model item, of the given type.If there is no model item with the given key,
null
is returned.If the model item with the given key is assignment compatible with the given type it is returned.
If the model item is NOT assignment compatible with the given type, an
IllegalArgumentException
will be thrown.Note: generic types are completely ignored for assignment compatiblity, due to Java's type erasure.
- Type Parameters:
T
- the target type of the model item- Parameters:
key
- the model item keytype
- the target type of the model item- Returns:
- the model item
-
-