Class HeadersRoute.HeaderMatcher

java.lang.Object
io.inverno.mod.http.base.router.HeadersRoute.HeaderMatcher
Enclosing interface:
HeadersRoute<A>

public static final class HeadersRoute.HeaderMatcher extends Object

A header matcher used to match a header against a list of static values or or a list of patterns.

A header is matched if any of the static values or patterns defined in the matcher are matching the value.

Since:
1.12
Author:
Jeremy Kuhn
  • Constructor Details

    • HeaderMatcher

      public HeaderMatcher(Set<String> staticValues, Set<Pattern> patternValues)

      Creates a header matcher.

      Parameters:
      staticValues - a list of static values
      patternValues - a list of patterns
  • Method Details

    • getValues

      public Set<String> getValues()

      Returns the static values matched by the matcher.

      Returns:
      a set of values
    • getPatterns

      public Set<Pattern> getPatterns()

      Returns the patterns matched by the matcher.

      Returns:
      a set of patterns
    • matches

      public boolean matches(String headerValue)

      Matches the specified header value.

      Parameters:
      headerValue - a header value
      Returns:
      true if any of the static values or patterns is matching the header value, false otherwise
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object