Class MapContextVariablesImpl

    • Constructor Detail

      • MapContextVariablesImpl

        public MapContextVariablesImpl()
        Creates empty variables provider.
      • MapContextVariablesImpl

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

      • get

        @Nullable
        public Object get​(@NotNull
                          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 Object remove​(@NotNull
                             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 Object put​(@NotNull
                          String name,
                          @NotNull
                          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
      • 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