Interface TextTemplateModel

  • All Superinterfaces:
    java.util.Map<java.lang.String,​java.lang.Object>

    public interface TextTemplateModel
    extends java.util.Map<java.lang.String,​java.lang.Object>
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T get​(java.lang.String key, com.google.common.reflect.TypeToken<T> type)
      Retrieve the given model item, of the given type.
      <T> T get​(java.lang.String key, java.lang.Class<T> type)
      Retrieve the given model item, of the given type.
      java.util.Map<java.lang.String,​java.lang.Object> map​(java.lang.String key)  
      <K,​V>
      java.util.Map<K,​V>
      map​(java.lang.String key, java.lang.Class<K> keyType, java.lang.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

      • map

        <K,​V> java.util.Map<K,​V> map​(java.lang.String key,
                                                 java.lang.Class<K> keyType,
                                                 java.lang.Class<V> valueType)
      • map

        java.util.Map<java.lang.String,​java.lang.Object> map​(java.lang.String key)
      • get

        <T> T get​(java.lang.String key,
                  java.lang.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 key
        type - the target type of the model item
        Returns:
        the model item
      • get

        <T> T get​(java.lang.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 key
        type - the target type of the model item
        Returns:
        the model item