Class ImmutableMapImpl

  • All Implemented Interfaces:
    ImmutableMap

    public class ImmutableMapImpl
    extends java.lang.Object
    implements ImmutableMap
    Internal class only, not in the public API. Spoon implementation of ImmutableMap
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​java.lang.Object> map  
      protected ImmutableMap parent  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImmutableMapImpl()  
      ImmutableMapImpl​(java.util.Map<java.lang.String,​java.lang.Object> map)  
      ImmutableMapImpl​(java.util.Map<java.lang.String,​java.lang.Object> map, java.lang.String parameterName, java.lang.Object value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> asMap()  
      ImmutableMapImpl checkpoint()  
      boolean equals​(java.lang.Object obj)  
      java.util.Map<java.lang.String,​java.lang.Object> getModifiedValues()  
      java.lang.Object getValue​(java.lang.String parameterName)  
      boolean hasValue​(java.lang.String parameterName)  
      ImmutableMap putValue​(java.lang.String parameterName, java.lang.Object value)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • map

        protected final java.util.Map<java.lang.String,​java.lang.Object> map
    • Constructor Detail

      • ImmutableMapImpl

        public ImmutableMapImpl​(java.util.Map<java.lang.String,​java.lang.Object> map)
      • ImmutableMapImpl

        public ImmutableMapImpl​(java.util.Map<java.lang.String,​java.lang.Object> map,
                                java.lang.String parameterName,
                                java.lang.Object value)
      • ImmutableMapImpl

        public ImmutableMapImpl()
    • Method Detail

      • hasValue

        public boolean hasValue​(java.lang.String parameterName)
        Specified by:
        hasValue in interface ImmutableMap
        Parameters:
        parameterName - to be checked parameter name
        Returns:
        true if there is defined some value for the parameter. null can be a value too
      • getValue

        public java.lang.Object getValue​(java.lang.String parameterName)
        Specified by:
        getValue in interface ImmutableMap
        Parameters:
        parameterName - the name of the parameter
        Returns:
        a value of the parameter under the name `parameterNamer
      • putValue

        public ImmutableMap putValue​(java.lang.String parameterName,
                                     java.lang.Object value)
        Specified by:
        putValue in interface ImmutableMap
        Parameters:
        parameterName - to be set parameter name
        value - the new value
        Returns:
        copies this ImmutableMap, sets the new value there and returns that copy
      • toString

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

        public java.util.Map<java.lang.String,​java.lang.Object> asMap()
        Specified by:
        asMap in interface ImmutableMap
        Returns:
        underlying unmodifiable Map<String, Object>
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object