Class QueryParametersRoute.ParameterMatcher

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

public static final class QueryParametersRoute.ParameterMatcher extends Object

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

A parameter 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

    • ParameterMatcher

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

      Creates a parameter 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 value)

      Matches the specified parameter value.

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object