
io.envoyproxy.envoy.api.v2.route.HeaderMatcher Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: envoy/api/v2/route/route_components.proto
package io.envoyproxy.envoy.api.v2.route;
/**
*
* .. attention::
* Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host*
* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
* .. attention::
* To route on HTTP method, use the special HTTP/2 *:method* header. This works for both
* HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g.,
* .. code-block:: json
* {
* "name": ":method",
* "exact_match": "POST"
* }
* .. attention::
* In the absence of any header match specifier, match will default to :ref:`present_match
* <envoy_api_field_route.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name
* <envoy_api_field_route.HeaderMatcher.name>` header will match, regardless of the header's
* value.
* [#next-major-version: HeaderMatcher should be refactored to use StringMatcher.]
* [#next-free-field: 12]
*
*
* Protobuf type {@code envoy.api.v2.route.HeaderMatcher}
*/
public final class HeaderMatcher extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:envoy.api.v2.route.HeaderMatcher)
HeaderMatcherOrBuilder {
private static final long serialVersionUID = 0L;
// Use HeaderMatcher.newBuilder() to construct.
private HeaderMatcher(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private HeaderMatcher() {
name_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new HeaderMatcher();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private HeaderMatcher(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
headerMatchSpecifierCase_ = 4;
headerMatchSpecifier_ = s;
break;
}
case 42: {
java.lang.String s = input.readStringRequireUtf8();
headerMatchSpecifierCase_ = 5;
headerMatchSpecifier_ = s;
break;
}
case 50: {
io.envoyproxy.envoy.type.Int64Range.Builder subBuilder = null;
if (headerMatchSpecifierCase_ == 6) {
subBuilder = ((io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_).toBuilder();
}
headerMatchSpecifier_ =
input.readMessage(io.envoyproxy.envoy.type.Int64Range.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_);
headerMatchSpecifier_ = subBuilder.buildPartial();
}
headerMatchSpecifierCase_ = 6;
break;
}
case 56: {
headerMatchSpecifier_ = input.readBool();
headerMatchSpecifierCase_ = 7;
break;
}
case 64: {
invertMatch_ = input.readBool();
break;
}
case 74: {
java.lang.String s = input.readStringRequireUtf8();
headerMatchSpecifierCase_ = 9;
headerMatchSpecifier_ = s;
break;
}
case 82: {
java.lang.String s = input.readStringRequireUtf8();
headerMatchSpecifierCase_ = 10;
headerMatchSpecifier_ = s;
break;
}
case 90: {
io.envoyproxy.envoy.type.matcher.RegexMatcher.Builder subBuilder = null;
if (headerMatchSpecifierCase_ == 11) {
subBuilder = ((io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_).toBuilder();
}
headerMatchSpecifier_ =
input.readMessage(io.envoyproxy.envoy.type.matcher.RegexMatcher.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_);
headerMatchSpecifier_ = subBuilder.buildPartial();
}
headerMatchSpecifierCase_ = 11;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.api.v2.route.RouteComponentsProto.internal_static_envoy_api_v2_route_HeaderMatcher_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.api.v2.route.RouteComponentsProto.internal_static_envoy_api_v2_route_HeaderMatcher_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.api.v2.route.HeaderMatcher.class, io.envoyproxy.envoy.api.v2.route.HeaderMatcher.Builder.class);
}
private int headerMatchSpecifierCase_ = 0;
private java.lang.Object headerMatchSpecifier_;
public enum HeaderMatchSpecifierCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
EXACT_MATCH(4),
@java.lang.Deprecated REGEX_MATCH(5),
SAFE_REGEX_MATCH(11),
RANGE_MATCH(6),
PRESENT_MATCH(7),
PREFIX_MATCH(9),
SUFFIX_MATCH(10),
HEADERMATCHSPECIFIER_NOT_SET(0);
private final int value;
private HeaderMatchSpecifierCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static HeaderMatchSpecifierCase valueOf(int value) {
return forNumber(value);
}
public static HeaderMatchSpecifierCase forNumber(int value) {
switch (value) {
case 4: return EXACT_MATCH;
case 5: return REGEX_MATCH;
case 11: return SAFE_REGEX_MATCH;
case 6: return RANGE_MATCH;
case 7: return PRESENT_MATCH;
case 9: return PREFIX_MATCH;
case 10: return SUFFIX_MATCH;
case 0: return HEADERMATCHSPECIFIER_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public HeaderMatchSpecifierCase
getHeaderMatchSpecifierCase() {
return HeaderMatchSpecifierCase.forNumber(
headerMatchSpecifierCase_);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
*
* Specifies the name of the header in the request.
*
*
* string name = 1 [(.validate.rules) = { ... }
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
* Specifies the name of the header in the request.
*
*
* string name = 1 [(.validate.rules) = { ... }
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int EXACT_MATCH_FIELD_NUMBER = 4;
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @return Whether the exactMatch field is set.
*/
public boolean hasExactMatch() {
return headerMatchSpecifierCase_ == 4;
}
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @return The exactMatch.
*/
public java.lang.String getExactMatch() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 4) {
ref = headerMatchSpecifier_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (headerMatchSpecifierCase_ == 4) {
headerMatchSpecifier_ = s;
}
return s;
}
}
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @return The bytes for exactMatch.
*/
public com.google.protobuf.ByteString
getExactMatchBytes() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 4) {
ref = headerMatchSpecifier_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (headerMatchSpecifierCase_ == 4) {
headerMatchSpecifier_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int REGEX_MATCH_FIELD_NUMBER = 5;
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @return Whether the regexMatch field is set.
*/
@java.lang.Deprecated public boolean hasRegexMatch() {
return headerMatchSpecifierCase_ == 5;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @return The regexMatch.
*/
@java.lang.Deprecated public java.lang.String getRegexMatch() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 5) {
ref = headerMatchSpecifier_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (headerMatchSpecifierCase_ == 5) {
headerMatchSpecifier_ = s;
}
return s;
}
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @return The bytes for regexMatch.
*/
@java.lang.Deprecated public com.google.protobuf.ByteString
getRegexMatchBytes() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 5) {
ref = headerMatchSpecifier_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (headerMatchSpecifierCase_ == 5) {
headerMatchSpecifier_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SAFE_REGEX_MATCH_FIELD_NUMBER = 11;
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
* @return Whether the safeRegexMatch field is set.
*/
@java.lang.Override
public boolean hasSafeRegexMatch() {
return headerMatchSpecifierCase_ == 11;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
* @return The safeRegexMatch.
*/
@java.lang.Override
public io.envoyproxy.envoy.type.matcher.RegexMatcher getSafeRegexMatch() {
if (headerMatchSpecifierCase_ == 11) {
return (io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_;
}
return io.envoyproxy.envoy.type.matcher.RegexMatcher.getDefaultInstance();
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
*/
@java.lang.Override
public io.envoyproxy.envoy.type.matcher.RegexMatcherOrBuilder getSafeRegexMatchOrBuilder() {
if (headerMatchSpecifierCase_ == 11) {
return (io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_;
}
return io.envoyproxy.envoy.type.matcher.RegexMatcher.getDefaultInstance();
}
public static final int RANGE_MATCH_FIELD_NUMBER = 6;
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
* @return Whether the rangeMatch field is set.
*/
@java.lang.Override
public boolean hasRangeMatch() {
return headerMatchSpecifierCase_ == 6;
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
* @return The rangeMatch.
*/
@java.lang.Override
public io.envoyproxy.envoy.type.Int64Range getRangeMatch() {
if (headerMatchSpecifierCase_ == 6) {
return (io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_;
}
return io.envoyproxy.envoy.type.Int64Range.getDefaultInstance();
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
*/
@java.lang.Override
public io.envoyproxy.envoy.type.Int64RangeOrBuilder getRangeMatchOrBuilder() {
if (headerMatchSpecifierCase_ == 6) {
return (io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_;
}
return io.envoyproxy.envoy.type.Int64Range.getDefaultInstance();
}
public static final int PRESENT_MATCH_FIELD_NUMBER = 7;
/**
*
* If specified, header match will be performed based on whether the header is in the
* request.
*
*
* bool present_match = 7;
* @return Whether the presentMatch field is set.
*/
@java.lang.Override
public boolean hasPresentMatch() {
return headerMatchSpecifierCase_ == 7;
}
/**
*
* If specified, header match will be performed based on whether the header is in the
* request.
*
*
* bool present_match = 7;
* @return The presentMatch.
*/
@java.lang.Override
public boolean getPresentMatch() {
if (headerMatchSpecifierCase_ == 7) {
return (java.lang.Boolean) headerMatchSpecifier_;
}
return false;
}
public static final int PREFIX_MATCH_FIELD_NUMBER = 9;
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @return Whether the prefixMatch field is set.
*/
public boolean hasPrefixMatch() {
return headerMatchSpecifierCase_ == 9;
}
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @return The prefixMatch.
*/
public java.lang.String getPrefixMatch() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 9) {
ref = headerMatchSpecifier_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (headerMatchSpecifierCase_ == 9) {
headerMatchSpecifier_ = s;
}
return s;
}
}
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @return The bytes for prefixMatch.
*/
public com.google.protobuf.ByteString
getPrefixMatchBytes() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 9) {
ref = headerMatchSpecifier_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (headerMatchSpecifierCase_ == 9) {
headerMatchSpecifier_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SUFFIX_MATCH_FIELD_NUMBER = 10;
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @return Whether the suffixMatch field is set.
*/
public boolean hasSuffixMatch() {
return headerMatchSpecifierCase_ == 10;
}
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @return The suffixMatch.
*/
public java.lang.String getSuffixMatch() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 10) {
ref = headerMatchSpecifier_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (headerMatchSpecifierCase_ == 10) {
headerMatchSpecifier_ = s;
}
return s;
}
}
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @return The bytes for suffixMatch.
*/
public com.google.protobuf.ByteString
getSuffixMatchBytes() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 10) {
ref = headerMatchSpecifier_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (headerMatchSpecifierCase_ == 10) {
headerMatchSpecifier_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int INVERT_MATCH_FIELD_NUMBER = 8;
private boolean invertMatch_;
/**
*
* If specified, the match result will be inverted before checking. Defaults to false.
* Examples:
* * The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted.
* * The range [-10,0) will match the value -1, so it will not match when inverted.
*
*
* bool invert_match = 8;
* @return The invertMatch.
*/
@java.lang.Override
public boolean getInvertMatch() {
return invertMatch_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (headerMatchSpecifierCase_ == 4) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 5) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 6) {
output.writeMessage(6, (io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 7) {
output.writeBool(
7, (boolean)((java.lang.Boolean) headerMatchSpecifier_));
}
if (invertMatch_ != false) {
output.writeBool(8, invertMatch_);
}
if (headerMatchSpecifierCase_ == 9) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 9, headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 10) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 10, headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 11) {
output.writeMessage(11, (io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (headerMatchSpecifierCase_ == 4) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 5) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 6) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, (io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 7) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
7, (boolean)((java.lang.Boolean) headerMatchSpecifier_));
}
if (invertMatch_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(8, invertMatch_);
}
if (headerMatchSpecifierCase_ == 9) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 10) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, headerMatchSpecifier_);
}
if (headerMatchSpecifierCase_ == 11) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(11, (io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.envoyproxy.envoy.api.v2.route.HeaderMatcher)) {
return super.equals(obj);
}
io.envoyproxy.envoy.api.v2.route.HeaderMatcher other = (io.envoyproxy.envoy.api.v2.route.HeaderMatcher) obj;
if (!getName()
.equals(other.getName())) return false;
if (getInvertMatch()
!= other.getInvertMatch()) return false;
if (!getHeaderMatchSpecifierCase().equals(other.getHeaderMatchSpecifierCase())) return false;
switch (headerMatchSpecifierCase_) {
case 4:
if (!getExactMatch()
.equals(other.getExactMatch())) return false;
break;
case 5:
if (!getRegexMatch()
.equals(other.getRegexMatch())) return false;
break;
case 11:
if (!getSafeRegexMatch()
.equals(other.getSafeRegexMatch())) return false;
break;
case 6:
if (!getRangeMatch()
.equals(other.getRangeMatch())) return false;
break;
case 7:
if (getPresentMatch()
!= other.getPresentMatch()) return false;
break;
case 9:
if (!getPrefixMatch()
.equals(other.getPrefixMatch())) return false;
break;
case 10:
if (!getSuffixMatch()
.equals(other.getSuffixMatch())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + INVERT_MATCH_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getInvertMatch());
switch (headerMatchSpecifierCase_) {
case 4:
hash = (37 * hash) + EXACT_MATCH_FIELD_NUMBER;
hash = (53 * hash) + getExactMatch().hashCode();
break;
case 5:
hash = (37 * hash) + REGEX_MATCH_FIELD_NUMBER;
hash = (53 * hash) + getRegexMatch().hashCode();
break;
case 11:
hash = (37 * hash) + SAFE_REGEX_MATCH_FIELD_NUMBER;
hash = (53 * hash) + getSafeRegexMatch().hashCode();
break;
case 6:
hash = (37 * hash) + RANGE_MATCH_FIELD_NUMBER;
hash = (53 * hash) + getRangeMatch().hashCode();
break;
case 7:
hash = (37 * hash) + PRESENT_MATCH_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getPresentMatch());
break;
case 9:
hash = (37 * hash) + PREFIX_MATCH_FIELD_NUMBER;
hash = (53 * hash) + getPrefixMatch().hashCode();
break;
case 10:
hash = (37 * hash) + SUFFIX_MATCH_FIELD_NUMBER;
hash = (53 * hash) + getSuffixMatch().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.envoyproxy.envoy.api.v2.route.HeaderMatcher prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* .. attention::
* Internally, Envoy always uses the HTTP/2 *:authority* header to represent the HTTP/1 *Host*
* header. Thus, if attempting to match on *Host*, match on *:authority* instead.
* .. attention::
* To route on HTTP method, use the special HTTP/2 *:method* header. This works for both
* HTTP/1 and HTTP/2 as Envoy normalizes headers. E.g.,
* .. code-block:: json
* {
* "name": ":method",
* "exact_match": "POST"
* }
* .. attention::
* In the absence of any header match specifier, match will default to :ref:`present_match
* <envoy_api_field_route.HeaderMatcher.present_match>`. i.e, a request that has the :ref:`name
* <envoy_api_field_route.HeaderMatcher.name>` header will match, regardless of the header's
* value.
* [#next-major-version: HeaderMatcher should be refactored to use StringMatcher.]
* [#next-free-field: 12]
*
*
* Protobuf type {@code envoy.api.v2.route.HeaderMatcher}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:envoy.api.v2.route.HeaderMatcher)
io.envoyproxy.envoy.api.v2.route.HeaderMatcherOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.envoyproxy.envoy.api.v2.route.RouteComponentsProto.internal_static_envoy_api_v2_route_HeaderMatcher_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.envoyproxy.envoy.api.v2.route.RouteComponentsProto.internal_static_envoy_api_v2_route_HeaderMatcher_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.envoyproxy.envoy.api.v2.route.HeaderMatcher.class, io.envoyproxy.envoy.api.v2.route.HeaderMatcher.Builder.class);
}
// Construct using io.envoyproxy.envoy.api.v2.route.HeaderMatcher.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
invertMatch_ = false;
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.envoyproxy.envoy.api.v2.route.RouteComponentsProto.internal_static_envoy_api_v2_route_HeaderMatcher_descriptor;
}
@java.lang.Override
public io.envoyproxy.envoy.api.v2.route.HeaderMatcher getDefaultInstanceForType() {
return io.envoyproxy.envoy.api.v2.route.HeaderMatcher.getDefaultInstance();
}
@java.lang.Override
public io.envoyproxy.envoy.api.v2.route.HeaderMatcher build() {
io.envoyproxy.envoy.api.v2.route.HeaderMatcher result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.envoyproxy.envoy.api.v2.route.HeaderMatcher buildPartial() {
io.envoyproxy.envoy.api.v2.route.HeaderMatcher result = new io.envoyproxy.envoy.api.v2.route.HeaderMatcher(this);
result.name_ = name_;
if (headerMatchSpecifierCase_ == 4) {
result.headerMatchSpecifier_ = headerMatchSpecifier_;
}
if (headerMatchSpecifierCase_ == 5) {
result.headerMatchSpecifier_ = headerMatchSpecifier_;
}
if (headerMatchSpecifierCase_ == 11) {
if (safeRegexMatchBuilder_ == null) {
result.headerMatchSpecifier_ = headerMatchSpecifier_;
} else {
result.headerMatchSpecifier_ = safeRegexMatchBuilder_.build();
}
}
if (headerMatchSpecifierCase_ == 6) {
if (rangeMatchBuilder_ == null) {
result.headerMatchSpecifier_ = headerMatchSpecifier_;
} else {
result.headerMatchSpecifier_ = rangeMatchBuilder_.build();
}
}
if (headerMatchSpecifierCase_ == 7) {
result.headerMatchSpecifier_ = headerMatchSpecifier_;
}
if (headerMatchSpecifierCase_ == 9) {
result.headerMatchSpecifier_ = headerMatchSpecifier_;
}
if (headerMatchSpecifierCase_ == 10) {
result.headerMatchSpecifier_ = headerMatchSpecifier_;
}
result.invertMatch_ = invertMatch_;
result.headerMatchSpecifierCase_ = headerMatchSpecifierCase_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.envoyproxy.envoy.api.v2.route.HeaderMatcher) {
return mergeFrom((io.envoyproxy.envoy.api.v2.route.HeaderMatcher)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.envoyproxy.envoy.api.v2.route.HeaderMatcher other) {
if (other == io.envoyproxy.envoy.api.v2.route.HeaderMatcher.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (other.getInvertMatch() != false) {
setInvertMatch(other.getInvertMatch());
}
switch (other.getHeaderMatchSpecifierCase()) {
case EXACT_MATCH: {
headerMatchSpecifierCase_ = 4;
headerMatchSpecifier_ = other.headerMatchSpecifier_;
onChanged();
break;
}
case REGEX_MATCH: {
headerMatchSpecifierCase_ = 5;
headerMatchSpecifier_ = other.headerMatchSpecifier_;
onChanged();
break;
}
case SAFE_REGEX_MATCH: {
mergeSafeRegexMatch(other.getSafeRegexMatch());
break;
}
case RANGE_MATCH: {
mergeRangeMatch(other.getRangeMatch());
break;
}
case PRESENT_MATCH: {
setPresentMatch(other.getPresentMatch());
break;
}
case PREFIX_MATCH: {
headerMatchSpecifierCase_ = 9;
headerMatchSpecifier_ = other.headerMatchSpecifier_;
onChanged();
break;
}
case SUFFIX_MATCH: {
headerMatchSpecifierCase_ = 10;
headerMatchSpecifier_ = other.headerMatchSpecifier_;
onChanged();
break;
}
case HEADERMATCHSPECIFIER_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.envoyproxy.envoy.api.v2.route.HeaderMatcher parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.envoyproxy.envoy.api.v2.route.HeaderMatcher) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int headerMatchSpecifierCase_ = 0;
private java.lang.Object headerMatchSpecifier_;
public HeaderMatchSpecifierCase
getHeaderMatchSpecifierCase() {
return HeaderMatchSpecifierCase.forNumber(
headerMatchSpecifierCase_);
}
public Builder clearHeaderMatchSpecifier() {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
onChanged();
return this;
}
private java.lang.Object name_ = "";
/**
*
* Specifies the name of the header in the request.
*
*
* string name = 1 [(.validate.rules) = { ... }
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Specifies the name of the header in the request.
*
*
* string name = 1 [(.validate.rules) = { ... }
* @return The bytes for name.
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Specifies the name of the header in the request.
*
*
* string name = 1 [(.validate.rules) = { ... }
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
* Specifies the name of the header in the request.
*
*
* string name = 1 [(.validate.rules) = { ... }
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
* Specifies the name of the header in the request.
*
*
* string name = 1 [(.validate.rules) = { ... }
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @return Whether the exactMatch field is set.
*/
@java.lang.Override
public boolean hasExactMatch() {
return headerMatchSpecifierCase_ == 4;
}
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @return The exactMatch.
*/
@java.lang.Override
public java.lang.String getExactMatch() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 4) {
ref = headerMatchSpecifier_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (headerMatchSpecifierCase_ == 4) {
headerMatchSpecifier_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @return The bytes for exactMatch.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getExactMatchBytes() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 4) {
ref = headerMatchSpecifier_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (headerMatchSpecifierCase_ == 4) {
headerMatchSpecifier_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @param value The exactMatch to set.
* @return This builder for chaining.
*/
public Builder setExactMatch(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
headerMatchSpecifierCase_ = 4;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @return This builder for chaining.
*/
public Builder clearExactMatch() {
if (headerMatchSpecifierCase_ == 4) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
onChanged();
}
return this;
}
/**
*
* If specified, header match will be performed based on the value of the header.
*
*
* string exact_match = 4;
* @param value The bytes for exactMatch to set.
* @return This builder for chaining.
*/
public Builder setExactMatchBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
headerMatchSpecifierCase_ = 4;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @return Whether the regexMatch field is set.
*/
@java.lang.Override
@java.lang.Deprecated public boolean hasRegexMatch() {
return headerMatchSpecifierCase_ == 5;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @return The regexMatch.
*/
@java.lang.Override
@java.lang.Deprecated public java.lang.String getRegexMatch() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 5) {
ref = headerMatchSpecifier_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (headerMatchSpecifierCase_ == 5) {
headerMatchSpecifier_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @return The bytes for regexMatch.
*/
@java.lang.Override
@java.lang.Deprecated public com.google.protobuf.ByteString
getRegexMatchBytes() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 5) {
ref = headerMatchSpecifier_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (headerMatchSpecifierCase_ == 5) {
headerMatchSpecifier_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @param value The regexMatch to set.
* @return This builder for chaining.
*/
@java.lang.Deprecated public Builder setRegexMatch(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
headerMatchSpecifierCase_ = 5;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @return This builder for chaining.
*/
@java.lang.Deprecated public Builder clearRegexMatch() {
if (headerMatchSpecifierCase_ == 5) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
onChanged();
}
return this;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex. The regex grammar used in the value field is defined
* `here <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
* Examples:
* * The regex ``\d{3}`` matches the value *123*
* * The regex ``\d{3}`` does not match the value *1234*
* * The regex ``\d{3}`` does not match the value *123.456*
* .. attention::
* This field has been deprecated in favor of `safe_regex_match` as it is not safe for use
* with untrusted input in all cases.
*
*
* string regex_match = 5 [deprecated = true, (.validate.rules) = { ... }
* @deprecated envoy.api.v2.route.HeaderMatcher.regex_match is deprecated.
* See envoy/api/v2/route/route_components.proto;l=1542
* @param value The bytes for regexMatch to set.
* @return This builder for chaining.
*/
@java.lang.Deprecated public Builder setRegexMatchBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
headerMatchSpecifierCase_ = 5;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.matcher.RegexMatcher, io.envoyproxy.envoy.type.matcher.RegexMatcher.Builder, io.envoyproxy.envoy.type.matcher.RegexMatcherOrBuilder> safeRegexMatchBuilder_;
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
* @return Whether the safeRegexMatch field is set.
*/
@java.lang.Override
public boolean hasSafeRegexMatch() {
return headerMatchSpecifierCase_ == 11;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
* @return The safeRegexMatch.
*/
@java.lang.Override
public io.envoyproxy.envoy.type.matcher.RegexMatcher getSafeRegexMatch() {
if (safeRegexMatchBuilder_ == null) {
if (headerMatchSpecifierCase_ == 11) {
return (io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_;
}
return io.envoyproxy.envoy.type.matcher.RegexMatcher.getDefaultInstance();
} else {
if (headerMatchSpecifierCase_ == 11) {
return safeRegexMatchBuilder_.getMessage();
}
return io.envoyproxy.envoy.type.matcher.RegexMatcher.getDefaultInstance();
}
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
*/
public Builder setSafeRegexMatch(io.envoyproxy.envoy.type.matcher.RegexMatcher value) {
if (safeRegexMatchBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
headerMatchSpecifier_ = value;
onChanged();
} else {
safeRegexMatchBuilder_.setMessage(value);
}
headerMatchSpecifierCase_ = 11;
return this;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
*/
public Builder setSafeRegexMatch(
io.envoyproxy.envoy.type.matcher.RegexMatcher.Builder builderForValue) {
if (safeRegexMatchBuilder_ == null) {
headerMatchSpecifier_ = builderForValue.build();
onChanged();
} else {
safeRegexMatchBuilder_.setMessage(builderForValue.build());
}
headerMatchSpecifierCase_ = 11;
return this;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
*/
public Builder mergeSafeRegexMatch(io.envoyproxy.envoy.type.matcher.RegexMatcher value) {
if (safeRegexMatchBuilder_ == null) {
if (headerMatchSpecifierCase_ == 11 &&
headerMatchSpecifier_ != io.envoyproxy.envoy.type.matcher.RegexMatcher.getDefaultInstance()) {
headerMatchSpecifier_ = io.envoyproxy.envoy.type.matcher.RegexMatcher.newBuilder((io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_)
.mergeFrom(value).buildPartial();
} else {
headerMatchSpecifier_ = value;
}
onChanged();
} else {
if (headerMatchSpecifierCase_ == 11) {
safeRegexMatchBuilder_.mergeFrom(value);
} else {
safeRegexMatchBuilder_.setMessage(value);
}
}
headerMatchSpecifierCase_ = 11;
return this;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
*/
public Builder clearSafeRegexMatch() {
if (safeRegexMatchBuilder_ == null) {
if (headerMatchSpecifierCase_ == 11) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
onChanged();
}
} else {
if (headerMatchSpecifierCase_ == 11) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
}
safeRegexMatchBuilder_.clear();
}
return this;
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
*/
public io.envoyproxy.envoy.type.matcher.RegexMatcher.Builder getSafeRegexMatchBuilder() {
return getSafeRegexMatchFieldBuilder().getBuilder();
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
*/
@java.lang.Override
public io.envoyproxy.envoy.type.matcher.RegexMatcherOrBuilder getSafeRegexMatchOrBuilder() {
if ((headerMatchSpecifierCase_ == 11) && (safeRegexMatchBuilder_ != null)) {
return safeRegexMatchBuilder_.getMessageOrBuilder();
} else {
if (headerMatchSpecifierCase_ == 11) {
return (io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_;
}
return io.envoyproxy.envoy.type.matcher.RegexMatcher.getDefaultInstance();
}
}
/**
*
* If specified, this regex string is a regular expression rule which implies the entire request
* header value must match the regex. The rule will not match if only a subsequence of the
* request header value matches the regex.
*
*
* .envoy.type.matcher.RegexMatcher safe_regex_match = 11;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.matcher.RegexMatcher, io.envoyproxy.envoy.type.matcher.RegexMatcher.Builder, io.envoyproxy.envoy.type.matcher.RegexMatcherOrBuilder>
getSafeRegexMatchFieldBuilder() {
if (safeRegexMatchBuilder_ == null) {
if (!(headerMatchSpecifierCase_ == 11)) {
headerMatchSpecifier_ = io.envoyproxy.envoy.type.matcher.RegexMatcher.getDefaultInstance();
}
safeRegexMatchBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.matcher.RegexMatcher, io.envoyproxy.envoy.type.matcher.RegexMatcher.Builder, io.envoyproxy.envoy.type.matcher.RegexMatcherOrBuilder>(
(io.envoyproxy.envoy.type.matcher.RegexMatcher) headerMatchSpecifier_,
getParentForChildren(),
isClean());
headerMatchSpecifier_ = null;
}
headerMatchSpecifierCase_ = 11;
onChanged();;
return safeRegexMatchBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.Int64Range, io.envoyproxy.envoy.type.Int64Range.Builder, io.envoyproxy.envoy.type.Int64RangeOrBuilder> rangeMatchBuilder_;
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
* @return Whether the rangeMatch field is set.
*/
@java.lang.Override
public boolean hasRangeMatch() {
return headerMatchSpecifierCase_ == 6;
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
* @return The rangeMatch.
*/
@java.lang.Override
public io.envoyproxy.envoy.type.Int64Range getRangeMatch() {
if (rangeMatchBuilder_ == null) {
if (headerMatchSpecifierCase_ == 6) {
return (io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_;
}
return io.envoyproxy.envoy.type.Int64Range.getDefaultInstance();
} else {
if (headerMatchSpecifierCase_ == 6) {
return rangeMatchBuilder_.getMessage();
}
return io.envoyproxy.envoy.type.Int64Range.getDefaultInstance();
}
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
*/
public Builder setRangeMatch(io.envoyproxy.envoy.type.Int64Range value) {
if (rangeMatchBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
headerMatchSpecifier_ = value;
onChanged();
} else {
rangeMatchBuilder_.setMessage(value);
}
headerMatchSpecifierCase_ = 6;
return this;
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
*/
public Builder setRangeMatch(
io.envoyproxy.envoy.type.Int64Range.Builder builderForValue) {
if (rangeMatchBuilder_ == null) {
headerMatchSpecifier_ = builderForValue.build();
onChanged();
} else {
rangeMatchBuilder_.setMessage(builderForValue.build());
}
headerMatchSpecifierCase_ = 6;
return this;
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
*/
public Builder mergeRangeMatch(io.envoyproxy.envoy.type.Int64Range value) {
if (rangeMatchBuilder_ == null) {
if (headerMatchSpecifierCase_ == 6 &&
headerMatchSpecifier_ != io.envoyproxy.envoy.type.Int64Range.getDefaultInstance()) {
headerMatchSpecifier_ = io.envoyproxy.envoy.type.Int64Range.newBuilder((io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_)
.mergeFrom(value).buildPartial();
} else {
headerMatchSpecifier_ = value;
}
onChanged();
} else {
if (headerMatchSpecifierCase_ == 6) {
rangeMatchBuilder_.mergeFrom(value);
} else {
rangeMatchBuilder_.setMessage(value);
}
}
headerMatchSpecifierCase_ = 6;
return this;
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
*/
public Builder clearRangeMatch() {
if (rangeMatchBuilder_ == null) {
if (headerMatchSpecifierCase_ == 6) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
onChanged();
}
} else {
if (headerMatchSpecifierCase_ == 6) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
}
rangeMatchBuilder_.clear();
}
return this;
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
*/
public io.envoyproxy.envoy.type.Int64Range.Builder getRangeMatchBuilder() {
return getRangeMatchFieldBuilder().getBuilder();
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
*/
@java.lang.Override
public io.envoyproxy.envoy.type.Int64RangeOrBuilder getRangeMatchOrBuilder() {
if ((headerMatchSpecifierCase_ == 6) && (rangeMatchBuilder_ != null)) {
return rangeMatchBuilder_.getMessageOrBuilder();
} else {
if (headerMatchSpecifierCase_ == 6) {
return (io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_;
}
return io.envoyproxy.envoy.type.Int64Range.getDefaultInstance();
}
}
/**
*
* If specified, header match will be performed based on range.
* The rule will match if the request header value is within this range.
* The entire request header value must represent an integer in base 10 notation: consisting of
* an optional plus or minus sign followed by a sequence of digits. The rule will not match if
* the header value does not represent an integer. Match will fail for empty values, floating
* point numbers or if only a subsequence of the header value is an integer.
* Examples:
* * For range [-10,0), route will match for header value -1, but not for 0, "somestring", 10.9,
* "-1somestring"
*
*
* .envoy.type.Int64Range range_match = 6;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.Int64Range, io.envoyproxy.envoy.type.Int64Range.Builder, io.envoyproxy.envoy.type.Int64RangeOrBuilder>
getRangeMatchFieldBuilder() {
if (rangeMatchBuilder_ == null) {
if (!(headerMatchSpecifierCase_ == 6)) {
headerMatchSpecifier_ = io.envoyproxy.envoy.type.Int64Range.getDefaultInstance();
}
rangeMatchBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.envoyproxy.envoy.type.Int64Range, io.envoyproxy.envoy.type.Int64Range.Builder, io.envoyproxy.envoy.type.Int64RangeOrBuilder>(
(io.envoyproxy.envoy.type.Int64Range) headerMatchSpecifier_,
getParentForChildren(),
isClean());
headerMatchSpecifier_ = null;
}
headerMatchSpecifierCase_ = 6;
onChanged();;
return rangeMatchBuilder_;
}
/**
*
* If specified, header match will be performed based on whether the header is in the
* request.
*
*
* bool present_match = 7;
* @return Whether the presentMatch field is set.
*/
public boolean hasPresentMatch() {
return headerMatchSpecifierCase_ == 7;
}
/**
*
* If specified, header match will be performed based on whether the header is in the
* request.
*
*
* bool present_match = 7;
* @return The presentMatch.
*/
public boolean getPresentMatch() {
if (headerMatchSpecifierCase_ == 7) {
return (java.lang.Boolean) headerMatchSpecifier_;
}
return false;
}
/**
*
* If specified, header match will be performed based on whether the header is in the
* request.
*
*
* bool present_match = 7;
* @param value The presentMatch to set.
* @return This builder for chaining.
*/
public Builder setPresentMatch(boolean value) {
headerMatchSpecifierCase_ = 7;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
/**
*
* If specified, header match will be performed based on whether the header is in the
* request.
*
*
* bool present_match = 7;
* @return This builder for chaining.
*/
public Builder clearPresentMatch() {
if (headerMatchSpecifierCase_ == 7) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
onChanged();
}
return this;
}
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @return Whether the prefixMatch field is set.
*/
@java.lang.Override
public boolean hasPrefixMatch() {
return headerMatchSpecifierCase_ == 9;
}
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @return The prefixMatch.
*/
@java.lang.Override
public java.lang.String getPrefixMatch() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 9) {
ref = headerMatchSpecifier_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (headerMatchSpecifierCase_ == 9) {
headerMatchSpecifier_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @return The bytes for prefixMatch.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getPrefixMatchBytes() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 9) {
ref = headerMatchSpecifier_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (headerMatchSpecifierCase_ == 9) {
headerMatchSpecifier_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @param value The prefixMatch to set.
* @return This builder for chaining.
*/
public Builder setPrefixMatch(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
headerMatchSpecifierCase_ = 9;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @return This builder for chaining.
*/
public Builder clearPrefixMatch() {
if (headerMatchSpecifierCase_ == 9) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
onChanged();
}
return this;
}
/**
*
* If specified, header match will be performed based on the prefix of the header value.
* Note: empty prefix is not allowed, please use present_match instead.
* Examples:
* * The prefix *abcd* matches the value *abcdxyz*, but not for *abcxyz*.
*
*
* string prefix_match = 9 [(.validate.rules) = { ... }
* @param value The bytes for prefixMatch to set.
* @return This builder for chaining.
*/
public Builder setPrefixMatchBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
headerMatchSpecifierCase_ = 9;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @return Whether the suffixMatch field is set.
*/
@java.lang.Override
public boolean hasSuffixMatch() {
return headerMatchSpecifierCase_ == 10;
}
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @return The suffixMatch.
*/
@java.lang.Override
public java.lang.String getSuffixMatch() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 10) {
ref = headerMatchSpecifier_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (headerMatchSpecifierCase_ == 10) {
headerMatchSpecifier_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @return The bytes for suffixMatch.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getSuffixMatchBytes() {
java.lang.Object ref = "";
if (headerMatchSpecifierCase_ == 10) {
ref = headerMatchSpecifier_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (headerMatchSpecifierCase_ == 10) {
headerMatchSpecifier_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @param value The suffixMatch to set.
* @return This builder for chaining.
*/
public Builder setSuffixMatch(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
headerMatchSpecifierCase_ = 10;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @return This builder for chaining.
*/
public Builder clearSuffixMatch() {
if (headerMatchSpecifierCase_ == 10) {
headerMatchSpecifierCase_ = 0;
headerMatchSpecifier_ = null;
onChanged();
}
return this;
}
/**
*
* If specified, header match will be performed based on the suffix of the header value.
* Note: empty suffix is not allowed, please use present_match instead.
* Examples:
* * The suffix *abcd* matches the value *xyzabcd*, but not for *xyzbcd*.
*
*
* string suffix_match = 10 [(.validate.rules) = { ... }
* @param value The bytes for suffixMatch to set.
* @return This builder for chaining.
*/
public Builder setSuffixMatchBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
headerMatchSpecifierCase_ = 10;
headerMatchSpecifier_ = value;
onChanged();
return this;
}
private boolean invertMatch_ ;
/**
*
* If specified, the match result will be inverted before checking. Defaults to false.
* Examples:
* * The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted.
* * The range [-10,0) will match the value -1, so it will not match when inverted.
*
*
* bool invert_match = 8;
* @return The invertMatch.
*/
@java.lang.Override
public boolean getInvertMatch() {
return invertMatch_;
}
/**
*
* If specified, the match result will be inverted before checking. Defaults to false.
* Examples:
* * The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted.
* * The range [-10,0) will match the value -1, so it will not match when inverted.
*
*
* bool invert_match = 8;
* @param value The invertMatch to set.
* @return This builder for chaining.
*/
public Builder setInvertMatch(boolean value) {
invertMatch_ = value;
onChanged();
return this;
}
/**
*
* If specified, the match result will be inverted before checking. Defaults to false.
* Examples:
* * The regex ``\d{3}`` does not match the value *1234*, so it will match when inverted.
* * The range [-10,0) will match the value -1, so it will not match when inverted.
*
*
* bool invert_match = 8;
* @return This builder for chaining.
*/
public Builder clearInvertMatch() {
invertMatch_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:envoy.api.v2.route.HeaderMatcher)
}
// @@protoc_insertion_point(class_scope:envoy.api.v2.route.HeaderMatcher)
private static final io.envoyproxy.envoy.api.v2.route.HeaderMatcher DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.envoyproxy.envoy.api.v2.route.HeaderMatcher();
}
public static io.envoyproxy.envoy.api.v2.route.HeaderMatcher getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public HeaderMatcher parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new HeaderMatcher(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.envoyproxy.envoy.api.v2.route.HeaderMatcher getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy