Class MapContextVariablesImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(java.lang.String name)  
      java.util.Map<java.lang.String,​java.lang.Object> getAll()  
      java.lang.Object put​(java.lang.String name, java.lang.Object value)
      Adds a variable to the backing map
      void putAll​(java.util.Map<java.lang.String,​java.lang.Object> fromMap)
      Adds multiple variables to the backing map
      java.lang.Object remove​(java.lang.String name)
      Removes variable with the name from the backing map
      int size()
      Returns the number of variables in this variables provider.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MapContextVariablesImpl

        public MapContextVariablesImpl()
        Creates empty variables provider.
      • MapContextVariablesImpl

        public MapContextVariablesImpl​(java.util.Map<java.lang.String,​java.lang.Object> variables)
        Parameters:
        variables - variables map to use as initializer. A copy will be created as backing storage.
    • Method Detail

      • get

        @Nullable
        public java.lang.Object get​(@NotNull
                                    java.lang.String name)
        Specified by:
        get in interface ContextVariables
        Specified by:
        get in interface MapContextVariables
        Parameters:
        name - the name of the variable
        Returns:
        the variable stored or null is the variable with the name cannot be found.
      • remove

        public java.lang.Object remove​(@NotNull
                                       java.lang.String name)
        Description copied from interface: MapContextVariables
        Removes variable with the name from the backing map
        Specified by:
        remove in interface MapContextVariables
        Parameters:
        name - name of the variable to be removed
        Returns:
        previous value associated with specified name, or null if there was no mapping for name.
      • put

        @Nullable
        public java.lang.Object put​(@NotNull
                                    java.lang.String name,
                                    @NotNull
                                    java.lang.Object value)
        Description copied from interface: MapContextVariables
        Adds a variable to the backing map
        Specified by:
        put in interface MapContextVariables
        Parameters:
        name - name of the variable to add
        value - value of the variable
        Returns:
        previous value associated with specified name, or null if there was no mapping for name
      • putAll

        public void putAll​(java.util.Map<java.lang.String,​java.lang.Object> fromMap)
        Description copied from interface: MapContextVariables
        Adds multiple variables to the backing map
        Specified by:
        putAll in interface MapContextVariables
        Parameters:
        fromMap - the map to add variables form
      • size

        public int size()
        Description copied from interface: ContextVariables
        Returns the number of variables in this variables provider. This is the size of the map returned by getAll method.
        Specified by:
        size in interface ContextVariables
        Specified by:
        size in interface MapContextVariables
        Returns:
        the size of the backing map
      • toString

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