Class TemplateTypeMap


  • public class TemplateTypeMap
    extends java.lang.Object
    Manages a mapping from TemplateType to its resolved JSType. Provides utility methods for cloning/extending the map.
    • Method Detail

      • copyWithExtension

        public TemplateTypeMap copyWithExtension​(TemplateTypeMap extension)
        Create a new map in which the keys and values have been extended by extension.

        Before extension, any unfilled values in the initial map will be filled with `?`.

      • copyWithExtension

        public TemplateTypeMap copyWithExtension​(com.google.common.collect.ImmutableList<TemplateType> keys,
                                                 com.google.common.collect.ImmutableList<JSType> values)
        Create a new map in which the keys and values have been extended by keys and values respectively.

        Before extension, any unfilled values in the initial map will be filled with `?`.

      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
        Returns true if the map is empty; false otherwise.
      • getTemplateKeys

        public com.google.common.collect.ImmutableList<TemplateType> getTemplateKeys()
        Returns a list of all template keys.
      • getTemplateValues

        public com.google.common.collect.ImmutableList<JSType> getTemplateValues()
      • hasTemplateKey

        public boolean hasTemplateKey​(TemplateType templateKey)
        Returns true if this map contains the specified template key, false otherwise.
      • hasTemplateType

        public boolean hasTemplateType​(TemplateType key)
        Returns true if there is a JSType value associated with the specified template key; false otherwise.
      • getTemplateTypeKeyByName

        public TemplateType getTemplateTypeKeyByName​(java.lang.String keyName)
      • getResolvedTemplateType

        public JSType getResolvedTemplateType​(TemplateType key)
        Returns the JSType value associated with the specified template key. If no JSType value is associated, returns the upper bound for generic, UNKNOWN_TYPE if unspecified.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object