Class MapBasedXPathVariableResolver

    • Constructor Detail

      • MapBasedXPathVariableResolver

        public MapBasedXPathVariableResolver()
        Default ctor.
      • MapBasedXPathVariableResolver

        public MapBasedXPathVariableResolver​(@Nullable
                                             Map<String,​?> aVars)
        Ctor taking another map.
        Parameters:
        aVars - Variables to re-use. May be null.
    • Method Detail

      • addUniqueVariable

        @Nonnull
        public com.helger.commons.state.EChange addUniqueVariable​(@Nonnull
                                                                  String sName,
                                                                  @Nonnull
                                                                  Object aValue)
        Add a new variable.
        Parameters:
        sName - The name (=local part) of the variable
        aValue - The value to be used.
        Returns:
        EChange
      • addAllFrom

        @Nonnull
        public com.helger.commons.state.EChange addAllFrom​(@Nonnull
                                                           MapBasedXPathVariableResolver aOther,
                                                           boolean bOverwrite)
        Add all variables from the other variable resolver into this resolver.
        Parameters:
        aOther - The variable resolver to import the variable from. May not be null.
        bOverwrite - if true existing variables will be overwritten with the new variables, otherwise the old variables are kept.
        Returns:
        EChange
      • addAllFrom

        @Nonnull
        public com.helger.commons.state.EChange addAllFrom​(@Nonnull
                                                           MapBasedXPathVariableResolverQName aOther,
                                                           boolean bOverwrite)
        Add all variables from the other variable resolver into this resolver. This methods takes only the local part of the QName and loses the namespace URI.
        Parameters:
        aOther - The variable resolver to import the variable from. May not be null.
        bOverwrite - if true existing variables will be overwritten with the new variables, otherwise the old variables are kept.
        Returns:
        EChange
      • removeVariable

        @Nonnull
        public com.helger.commons.state.EChange removeVariable​(@Nullable
                                                               String sName)
        Remove the variable with the specified name.
        Parameters:
        sName - The name to be removed. May be null.
        Returns:
        EChange
      • removeVariables

        @Nonnull
        public com.helger.commons.state.EChange removeVariables​(@Nullable
                                                                Iterable<String> aNames)
        Remove multiple variables at once.
        Parameters:
        aNames - The names to be removed. May be null.
        Returns:
        EChange.CHANGED if at least one variable was removed.
      • getAllVariables

        @Nonnull
        @ReturnsMutableCopy
        public com.helger.commons.collection.impl.ICommonsMap<String,​?> getAllVariables()
        Returns:
        A mutable copy of all contained variables. Never null but maybe empty.
      • getVariableCount

        @Nonnegative
        public int getVariableCount()
        Returns:
        The number of contained variables. Always ≥ 0.
      • clear

        @Nonnull
        public com.helger.commons.state.EChange clear()
        Remove all variables at once.
        Returns:
        EChange.CHANGED if at least one variable was removed.
      • setAllVariables

        public void setAllVariables​(@Nullable
                                    Map<String,​?> aVars)
        Set multiple variables at once.
        Parameters:
        aVars - The variables to be set. May be null.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object