Package io.grpc.xds.internal
Class Matchers.HeaderMatcher
java.lang.Object
io.grpc.xds.internal.Matchers.HeaderMatcher
- Direct Known Subclasses:
AutoValue_Matchers_HeaderMatcher
- Enclosing class:
Matchers
Matcher for HTTP request headers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents an integer range. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String
contains()
private static Matchers.HeaderMatcher
create
(String name, String exactValue, com.google.re2j.Pattern safeRegEx, Matchers.HeaderMatcher.Range range, Boolean present, String prefix, String suffix, String contains, Matchers.StringMatcher stringMatcher, boolean inverted) abstract String
static Matchers.HeaderMatcher
forContains
(String name, String contains, boolean inverted) The request header value should have this substring.static Matchers.HeaderMatcher
forExactValue
(String name, String exactValue, boolean inverted) The request header value should exactly match the specified value.static Matchers.HeaderMatcher
The request header value should have this prefix.static Matchers.HeaderMatcher
forPresent
(String name, boolean present, boolean inverted) The request header value should exist.static Matchers.HeaderMatcher
forRange
(String name, Matchers.HeaderMatcher.Range range, boolean inverted) The request header value should be within the range.static Matchers.HeaderMatcher
forSafeRegEx
(String name, com.google.re2j.Pattern safeRegEx, boolean inverted) The request header value should match the regular expression pattern.static Matchers.HeaderMatcher
forString
(String name, Matchers.StringMatcher stringMatcher, boolean inverted) The request header value should match this stringMatcher.static Matchers.HeaderMatcher
The request header value should have this suffix.abstract boolean
inverted()
boolean
Returns the matching result.abstract String
name()
abstract String
prefix()
abstract Boolean
present()
abstract Matchers.HeaderMatcher.Range
range()
abstract com.google.re2j.Pattern
abstract Matchers.StringMatcher
abstract String
suffix()
-
Constructor Details
-
HeaderMatcher
public HeaderMatcher()
-
-
Method Details
-
name
-
exactValue
-
safeRegEx
-
range
-
present
-
prefix
-
suffix
-
contains
-
stringMatcher
-
inverted
public abstract boolean inverted() -
forExactValue
public static Matchers.HeaderMatcher forExactValue(String name, String exactValue, boolean inverted) The request header value should exactly match the specified value. -
forSafeRegEx
public static Matchers.HeaderMatcher forSafeRegEx(String name, com.google.re2j.Pattern safeRegEx, boolean inverted) The request header value should match the regular expression pattern. -
forRange
public static Matchers.HeaderMatcher forRange(String name, Matchers.HeaderMatcher.Range range, boolean inverted) The request header value should be within the range. -
forPresent
The request header value should exist. -
forPrefix
The request header value should have this prefix. -
forSuffix
The request header value should have this suffix. -
forContains
The request header value should have this substring. -
forString
public static Matchers.HeaderMatcher forString(String name, Matchers.StringMatcher stringMatcher, boolean inverted) The request header value should match this stringMatcher. -
create
private static Matchers.HeaderMatcher create(String name, @Nullable String exactValue, @Nullable com.google.re2j.Pattern safeRegEx, @Nullable Matchers.HeaderMatcher.Range range, @Nullable Boolean present, @Nullable String prefix, @Nullable String suffix, @Nullable String contains, @Nullable Matchers.StringMatcher stringMatcher, boolean inverted) -
matches
Returns the matching result.
-