Class HeaderPatternRule


  • public class HeaderPatternRule
    extends PatternRule
    Sets the header in the response whenever the rule finds a match.
    • Constructor Detail

      • HeaderPatternRule

        public HeaderPatternRule()
      • HeaderPatternRule

        public HeaderPatternRule​(@Name("pattern")
                                 String pattern,
                                 @Name("name")
                                 String name,
                                 @Name("value")
                                 String value)
    • Method Detail

      • setName

        public void setName​(String name)
        Sets the header name.
        Parameters:
        name - name of the header field
      • setValue

        public void setValue​(String value)
        Sets the header value. The value can be either a String or int value.
        Parameters:
        value - of the header field
      • setAdd

        public void setAdd​(boolean add)
        Sets the Add flag.
        Parameters:
        add - If true, the header is added to the response, otherwise the header it is set on the response.
      • getName

        public String getName()
        Returns the header name.
        Returns:
        the header name.
      • getValue

        public String getValue()
        Returns the header value.
        Returns:
        the header value.
      • isAdd

        public boolean isAdd()
        Returns the add flag value.
        Returns:
        true if add flag set