1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/compute/v1/compute.proto 18 19 package com.google.cloud.compute.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.compute.v1.HostRule} 29 */ 30 public final class HostRule extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.HostRule) 33 HostRuleOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use HostRule.newBuilder() to construct. HostRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private HostRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 HostRule()40 private HostRule() { 41 description_ = ""; 42 hosts_ = com.google.protobuf.LazyStringArrayList.EMPTY; 43 pathMatcher_ = ""; 44 } 45 46 @java.lang.Override 47 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)48 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 49 return new HostRule(); 50 } 51 52 @java.lang.Override getUnknownFields()53 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 54 return this.unknownFields; 55 } 56 getDescriptor()57 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 58 return com.google.cloud.compute.v1.Compute 59 .internal_static_google_cloud_compute_v1_HostRule_descriptor; 60 } 61 62 @java.lang.Override 63 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()64 internalGetFieldAccessorTable() { 65 return com.google.cloud.compute.v1.Compute 66 .internal_static_google_cloud_compute_v1_HostRule_fieldAccessorTable 67 .ensureFieldAccessorsInitialized( 68 com.google.cloud.compute.v1.HostRule.class, 69 com.google.cloud.compute.v1.HostRule.Builder.class); 70 } 71 72 private int bitField0_; 73 public static final int DESCRIPTION_FIELD_NUMBER = 422937596; 74 75 @SuppressWarnings("serial") 76 private volatile java.lang.Object description_ = ""; 77 /** 78 * 79 * 80 * <pre> 81 * An optional description of this resource. Provide this property when you create the resource. 82 * </pre> 83 * 84 * <code>optional string description = 422937596;</code> 85 * 86 * @return Whether the description field is set. 87 */ 88 @java.lang.Override hasDescription()89 public boolean hasDescription() { 90 return ((bitField0_ & 0x00000001) != 0); 91 } 92 /** 93 * 94 * 95 * <pre> 96 * An optional description of this resource. Provide this property when you create the resource. 97 * </pre> 98 * 99 * <code>optional string description = 422937596;</code> 100 * 101 * @return The description. 102 */ 103 @java.lang.Override getDescription()104 public java.lang.String getDescription() { 105 java.lang.Object ref = description_; 106 if (ref instanceof java.lang.String) { 107 return (java.lang.String) ref; 108 } else { 109 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 110 java.lang.String s = bs.toStringUtf8(); 111 description_ = s; 112 return s; 113 } 114 } 115 /** 116 * 117 * 118 * <pre> 119 * An optional description of this resource. Provide this property when you create the resource. 120 * </pre> 121 * 122 * <code>optional string description = 422937596;</code> 123 * 124 * @return The bytes for description. 125 */ 126 @java.lang.Override getDescriptionBytes()127 public com.google.protobuf.ByteString getDescriptionBytes() { 128 java.lang.Object ref = description_; 129 if (ref instanceof java.lang.String) { 130 com.google.protobuf.ByteString b = 131 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 132 description_ = b; 133 return b; 134 } else { 135 return (com.google.protobuf.ByteString) ref; 136 } 137 } 138 139 public static final int HOSTS_FIELD_NUMBER = 99467211; 140 141 @SuppressWarnings("serial") 142 private com.google.protobuf.LazyStringList hosts_; 143 /** 144 * 145 * 146 * <pre> 147 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 148 * </pre> 149 * 150 * <code>repeated string hosts = 99467211;</code> 151 * 152 * @return A list containing the hosts. 153 */ getHostsList()154 public com.google.protobuf.ProtocolStringList getHostsList() { 155 return hosts_; 156 } 157 /** 158 * 159 * 160 * <pre> 161 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 162 * </pre> 163 * 164 * <code>repeated string hosts = 99467211;</code> 165 * 166 * @return The count of hosts. 167 */ getHostsCount()168 public int getHostsCount() { 169 return hosts_.size(); 170 } 171 /** 172 * 173 * 174 * <pre> 175 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 176 * </pre> 177 * 178 * <code>repeated string hosts = 99467211;</code> 179 * 180 * @param index The index of the element to return. 181 * @return The hosts at the given index. 182 */ getHosts(int index)183 public java.lang.String getHosts(int index) { 184 return hosts_.get(index); 185 } 186 /** 187 * 188 * 189 * <pre> 190 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 191 * </pre> 192 * 193 * <code>repeated string hosts = 99467211;</code> 194 * 195 * @param index The index of the value to return. 196 * @return The bytes of the hosts at the given index. 197 */ getHostsBytes(int index)198 public com.google.protobuf.ByteString getHostsBytes(int index) { 199 return hosts_.getByteString(index); 200 } 201 202 public static final int PATH_MATCHER_FIELD_NUMBER = 337813272; 203 204 @SuppressWarnings("serial") 205 private volatile java.lang.Object pathMatcher_ = ""; 206 /** 207 * 208 * 209 * <pre> 210 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 211 * </pre> 212 * 213 * <code>optional string path_matcher = 337813272;</code> 214 * 215 * @return Whether the pathMatcher field is set. 216 */ 217 @java.lang.Override hasPathMatcher()218 public boolean hasPathMatcher() { 219 return ((bitField0_ & 0x00000002) != 0); 220 } 221 /** 222 * 223 * 224 * <pre> 225 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 226 * </pre> 227 * 228 * <code>optional string path_matcher = 337813272;</code> 229 * 230 * @return The pathMatcher. 231 */ 232 @java.lang.Override getPathMatcher()233 public java.lang.String getPathMatcher() { 234 java.lang.Object ref = pathMatcher_; 235 if (ref instanceof java.lang.String) { 236 return (java.lang.String) ref; 237 } else { 238 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 239 java.lang.String s = bs.toStringUtf8(); 240 pathMatcher_ = s; 241 return s; 242 } 243 } 244 /** 245 * 246 * 247 * <pre> 248 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 249 * </pre> 250 * 251 * <code>optional string path_matcher = 337813272;</code> 252 * 253 * @return The bytes for pathMatcher. 254 */ 255 @java.lang.Override getPathMatcherBytes()256 public com.google.protobuf.ByteString getPathMatcherBytes() { 257 java.lang.Object ref = pathMatcher_; 258 if (ref instanceof java.lang.String) { 259 com.google.protobuf.ByteString b = 260 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 261 pathMatcher_ = b; 262 return b; 263 } else { 264 return (com.google.protobuf.ByteString) ref; 265 } 266 } 267 268 private byte memoizedIsInitialized = -1; 269 270 @java.lang.Override isInitialized()271 public final boolean isInitialized() { 272 byte isInitialized = memoizedIsInitialized; 273 if (isInitialized == 1) return true; 274 if (isInitialized == 0) return false; 275 276 memoizedIsInitialized = 1; 277 return true; 278 } 279 280 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)281 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 282 for (int i = 0; i < hosts_.size(); i++) { 283 com.google.protobuf.GeneratedMessageV3.writeString(output, 99467211, hosts_.getRaw(i)); 284 } 285 if (((bitField0_ & 0x00000002) != 0)) { 286 com.google.protobuf.GeneratedMessageV3.writeString(output, 337813272, pathMatcher_); 287 } 288 if (((bitField0_ & 0x00000001) != 0)) { 289 com.google.protobuf.GeneratedMessageV3.writeString(output, 422937596, description_); 290 } 291 getUnknownFields().writeTo(output); 292 } 293 294 @java.lang.Override getSerializedSize()295 public int getSerializedSize() { 296 int size = memoizedSize; 297 if (size != -1) return size; 298 299 size = 0; 300 { 301 int dataSize = 0; 302 for (int i = 0; i < hosts_.size(); i++) { 303 dataSize += computeStringSizeNoTag(hosts_.getRaw(i)); 304 } 305 size += dataSize; 306 size += 5 * getHostsList().size(); 307 } 308 if (((bitField0_ & 0x00000002) != 0)) { 309 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(337813272, pathMatcher_); 310 } 311 if (((bitField0_ & 0x00000001) != 0)) { 312 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(422937596, description_); 313 } 314 size += getUnknownFields().getSerializedSize(); 315 memoizedSize = size; 316 return size; 317 } 318 319 @java.lang.Override equals(final java.lang.Object obj)320 public boolean equals(final java.lang.Object obj) { 321 if (obj == this) { 322 return true; 323 } 324 if (!(obj instanceof com.google.cloud.compute.v1.HostRule)) { 325 return super.equals(obj); 326 } 327 com.google.cloud.compute.v1.HostRule other = (com.google.cloud.compute.v1.HostRule) obj; 328 329 if (hasDescription() != other.hasDescription()) return false; 330 if (hasDescription()) { 331 if (!getDescription().equals(other.getDescription())) return false; 332 } 333 if (!getHostsList().equals(other.getHostsList())) return false; 334 if (hasPathMatcher() != other.hasPathMatcher()) return false; 335 if (hasPathMatcher()) { 336 if (!getPathMatcher().equals(other.getPathMatcher())) return false; 337 } 338 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 339 return true; 340 } 341 342 @java.lang.Override hashCode()343 public int hashCode() { 344 if (memoizedHashCode != 0) { 345 return memoizedHashCode; 346 } 347 int hash = 41; 348 hash = (19 * hash) + getDescriptor().hashCode(); 349 if (hasDescription()) { 350 hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; 351 hash = (53 * hash) + getDescription().hashCode(); 352 } 353 if (getHostsCount() > 0) { 354 hash = (37 * hash) + HOSTS_FIELD_NUMBER; 355 hash = (53 * hash) + getHostsList().hashCode(); 356 } 357 if (hasPathMatcher()) { 358 hash = (37 * hash) + PATH_MATCHER_FIELD_NUMBER; 359 hash = (53 * hash) + getPathMatcher().hashCode(); 360 } 361 hash = (29 * hash) + getUnknownFields().hashCode(); 362 memoizedHashCode = hash; 363 return hash; 364 } 365 parseFrom(java.nio.ByteBuffer data)366 public static com.google.cloud.compute.v1.HostRule parseFrom(java.nio.ByteBuffer data) 367 throws com.google.protobuf.InvalidProtocolBufferException { 368 return PARSER.parseFrom(data); 369 } 370 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)371 public static com.google.cloud.compute.v1.HostRule parseFrom( 372 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 373 throws com.google.protobuf.InvalidProtocolBufferException { 374 return PARSER.parseFrom(data, extensionRegistry); 375 } 376 parseFrom(com.google.protobuf.ByteString data)377 public static com.google.cloud.compute.v1.HostRule parseFrom(com.google.protobuf.ByteString data) 378 throws com.google.protobuf.InvalidProtocolBufferException { 379 return PARSER.parseFrom(data); 380 } 381 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)382 public static com.google.cloud.compute.v1.HostRule parseFrom( 383 com.google.protobuf.ByteString data, 384 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 385 throws com.google.protobuf.InvalidProtocolBufferException { 386 return PARSER.parseFrom(data, extensionRegistry); 387 } 388 parseFrom(byte[] data)389 public static com.google.cloud.compute.v1.HostRule parseFrom(byte[] data) 390 throws com.google.protobuf.InvalidProtocolBufferException { 391 return PARSER.parseFrom(data); 392 } 393 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)394 public static com.google.cloud.compute.v1.HostRule parseFrom( 395 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 396 throws com.google.protobuf.InvalidProtocolBufferException { 397 return PARSER.parseFrom(data, extensionRegistry); 398 } 399 parseFrom(java.io.InputStream input)400 public static com.google.cloud.compute.v1.HostRule parseFrom(java.io.InputStream input) 401 throws java.io.IOException { 402 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 403 } 404 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)405 public static com.google.cloud.compute.v1.HostRule parseFrom( 406 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 407 throws java.io.IOException { 408 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 409 PARSER, input, extensionRegistry); 410 } 411 parseDelimitedFrom(java.io.InputStream input)412 public static com.google.cloud.compute.v1.HostRule parseDelimitedFrom(java.io.InputStream input) 413 throws java.io.IOException { 414 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 415 } 416 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)417 public static com.google.cloud.compute.v1.HostRule parseDelimitedFrom( 418 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 419 throws java.io.IOException { 420 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 421 PARSER, input, extensionRegistry); 422 } 423 parseFrom( com.google.protobuf.CodedInputStream input)424 public static com.google.cloud.compute.v1.HostRule parseFrom( 425 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 426 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 427 } 428 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)429 public static com.google.cloud.compute.v1.HostRule parseFrom( 430 com.google.protobuf.CodedInputStream input, 431 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 432 throws java.io.IOException { 433 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 434 PARSER, input, extensionRegistry); 435 } 436 437 @java.lang.Override newBuilderForType()438 public Builder newBuilderForType() { 439 return newBuilder(); 440 } 441 newBuilder()442 public static Builder newBuilder() { 443 return DEFAULT_INSTANCE.toBuilder(); 444 } 445 newBuilder(com.google.cloud.compute.v1.HostRule prototype)446 public static Builder newBuilder(com.google.cloud.compute.v1.HostRule prototype) { 447 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 448 } 449 450 @java.lang.Override toBuilder()451 public Builder toBuilder() { 452 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 453 } 454 455 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)456 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 457 Builder builder = new Builder(parent); 458 return builder; 459 } 460 /** 461 * 462 * 463 * <pre> 464 * UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. 465 * </pre> 466 * 467 * Protobuf type {@code google.cloud.compute.v1.HostRule} 468 */ 469 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 470 implements 471 // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.HostRule) 472 com.google.cloud.compute.v1.HostRuleOrBuilder { getDescriptor()473 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 474 return com.google.cloud.compute.v1.Compute 475 .internal_static_google_cloud_compute_v1_HostRule_descriptor; 476 } 477 478 @java.lang.Override 479 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()480 internalGetFieldAccessorTable() { 481 return com.google.cloud.compute.v1.Compute 482 .internal_static_google_cloud_compute_v1_HostRule_fieldAccessorTable 483 .ensureFieldAccessorsInitialized( 484 com.google.cloud.compute.v1.HostRule.class, 485 com.google.cloud.compute.v1.HostRule.Builder.class); 486 } 487 488 // Construct using com.google.cloud.compute.v1.HostRule.newBuilder() Builder()489 private Builder() {} 490 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)491 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 492 super(parent); 493 } 494 495 @java.lang.Override clear()496 public Builder clear() { 497 super.clear(); 498 bitField0_ = 0; 499 description_ = ""; 500 hosts_ = com.google.protobuf.LazyStringArrayList.EMPTY; 501 bitField0_ = (bitField0_ & ~0x00000002); 502 pathMatcher_ = ""; 503 return this; 504 } 505 506 @java.lang.Override getDescriptorForType()507 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 508 return com.google.cloud.compute.v1.Compute 509 .internal_static_google_cloud_compute_v1_HostRule_descriptor; 510 } 511 512 @java.lang.Override getDefaultInstanceForType()513 public com.google.cloud.compute.v1.HostRule getDefaultInstanceForType() { 514 return com.google.cloud.compute.v1.HostRule.getDefaultInstance(); 515 } 516 517 @java.lang.Override build()518 public com.google.cloud.compute.v1.HostRule build() { 519 com.google.cloud.compute.v1.HostRule result = buildPartial(); 520 if (!result.isInitialized()) { 521 throw newUninitializedMessageException(result); 522 } 523 return result; 524 } 525 526 @java.lang.Override buildPartial()527 public com.google.cloud.compute.v1.HostRule buildPartial() { 528 com.google.cloud.compute.v1.HostRule result = new com.google.cloud.compute.v1.HostRule(this); 529 buildPartialRepeatedFields(result); 530 if (bitField0_ != 0) { 531 buildPartial0(result); 532 } 533 onBuilt(); 534 return result; 535 } 536 buildPartialRepeatedFields(com.google.cloud.compute.v1.HostRule result)537 private void buildPartialRepeatedFields(com.google.cloud.compute.v1.HostRule result) { 538 if (((bitField0_ & 0x00000002) != 0)) { 539 hosts_ = hosts_.getUnmodifiableView(); 540 bitField0_ = (bitField0_ & ~0x00000002); 541 } 542 result.hosts_ = hosts_; 543 } 544 buildPartial0(com.google.cloud.compute.v1.HostRule result)545 private void buildPartial0(com.google.cloud.compute.v1.HostRule result) { 546 int from_bitField0_ = bitField0_; 547 int to_bitField0_ = 0; 548 if (((from_bitField0_ & 0x00000001) != 0)) { 549 result.description_ = description_; 550 to_bitField0_ |= 0x00000001; 551 } 552 if (((from_bitField0_ & 0x00000004) != 0)) { 553 result.pathMatcher_ = pathMatcher_; 554 to_bitField0_ |= 0x00000002; 555 } 556 result.bitField0_ |= to_bitField0_; 557 } 558 559 @java.lang.Override clone()560 public Builder clone() { 561 return super.clone(); 562 } 563 564 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)565 public Builder setField( 566 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 567 return super.setField(field, value); 568 } 569 570 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)571 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 572 return super.clearField(field); 573 } 574 575 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)576 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 577 return super.clearOneof(oneof); 578 } 579 580 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)581 public Builder setRepeatedField( 582 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 583 return super.setRepeatedField(field, index, value); 584 } 585 586 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)587 public Builder addRepeatedField( 588 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 589 return super.addRepeatedField(field, value); 590 } 591 592 @java.lang.Override mergeFrom(com.google.protobuf.Message other)593 public Builder mergeFrom(com.google.protobuf.Message other) { 594 if (other instanceof com.google.cloud.compute.v1.HostRule) { 595 return mergeFrom((com.google.cloud.compute.v1.HostRule) other); 596 } else { 597 super.mergeFrom(other); 598 return this; 599 } 600 } 601 mergeFrom(com.google.cloud.compute.v1.HostRule other)602 public Builder mergeFrom(com.google.cloud.compute.v1.HostRule other) { 603 if (other == com.google.cloud.compute.v1.HostRule.getDefaultInstance()) return this; 604 if (other.hasDescription()) { 605 description_ = other.description_; 606 bitField0_ |= 0x00000001; 607 onChanged(); 608 } 609 if (!other.hosts_.isEmpty()) { 610 if (hosts_.isEmpty()) { 611 hosts_ = other.hosts_; 612 bitField0_ = (bitField0_ & ~0x00000002); 613 } else { 614 ensureHostsIsMutable(); 615 hosts_.addAll(other.hosts_); 616 } 617 onChanged(); 618 } 619 if (other.hasPathMatcher()) { 620 pathMatcher_ = other.pathMatcher_; 621 bitField0_ |= 0x00000004; 622 onChanged(); 623 } 624 this.mergeUnknownFields(other.getUnknownFields()); 625 onChanged(); 626 return this; 627 } 628 629 @java.lang.Override isInitialized()630 public final boolean isInitialized() { 631 return true; 632 } 633 634 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)635 public Builder mergeFrom( 636 com.google.protobuf.CodedInputStream input, 637 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 638 throws java.io.IOException { 639 if (extensionRegistry == null) { 640 throw new java.lang.NullPointerException(); 641 } 642 try { 643 boolean done = false; 644 while (!done) { 645 int tag = input.readTag(); 646 switch (tag) { 647 case 0: 648 done = true; 649 break; 650 case 795737690: 651 { 652 java.lang.String s = input.readStringRequireUtf8(); 653 ensureHostsIsMutable(); 654 hosts_.add(s); 655 break; 656 } // case 795737690 657 case -1592461118: 658 { 659 pathMatcher_ = input.readStringRequireUtf8(); 660 bitField0_ |= 0x00000004; 661 break; 662 } // case -1592461118 663 case -911466526: 664 { 665 description_ = input.readStringRequireUtf8(); 666 bitField0_ |= 0x00000001; 667 break; 668 } // case -911466526 669 default: 670 { 671 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 672 done = true; // was an endgroup tag 673 } 674 break; 675 } // default: 676 } // switch (tag) 677 } // while (!done) 678 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 679 throw e.unwrapIOException(); 680 } finally { 681 onChanged(); 682 } // finally 683 return this; 684 } 685 686 private int bitField0_; 687 688 private java.lang.Object description_ = ""; 689 /** 690 * 691 * 692 * <pre> 693 * An optional description of this resource. Provide this property when you create the resource. 694 * </pre> 695 * 696 * <code>optional string description = 422937596;</code> 697 * 698 * @return Whether the description field is set. 699 */ hasDescription()700 public boolean hasDescription() { 701 return ((bitField0_ & 0x00000001) != 0); 702 } 703 /** 704 * 705 * 706 * <pre> 707 * An optional description of this resource. Provide this property when you create the resource. 708 * </pre> 709 * 710 * <code>optional string description = 422937596;</code> 711 * 712 * @return The description. 713 */ getDescription()714 public java.lang.String getDescription() { 715 java.lang.Object ref = description_; 716 if (!(ref instanceof java.lang.String)) { 717 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 718 java.lang.String s = bs.toStringUtf8(); 719 description_ = s; 720 return s; 721 } else { 722 return (java.lang.String) ref; 723 } 724 } 725 /** 726 * 727 * 728 * <pre> 729 * An optional description of this resource. Provide this property when you create the resource. 730 * </pre> 731 * 732 * <code>optional string description = 422937596;</code> 733 * 734 * @return The bytes for description. 735 */ getDescriptionBytes()736 public com.google.protobuf.ByteString getDescriptionBytes() { 737 java.lang.Object ref = description_; 738 if (ref instanceof String) { 739 com.google.protobuf.ByteString b = 740 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 741 description_ = b; 742 return b; 743 } else { 744 return (com.google.protobuf.ByteString) ref; 745 } 746 } 747 /** 748 * 749 * 750 * <pre> 751 * An optional description of this resource. Provide this property when you create the resource. 752 * </pre> 753 * 754 * <code>optional string description = 422937596;</code> 755 * 756 * @param value The description to set. 757 * @return This builder for chaining. 758 */ setDescription(java.lang.String value)759 public Builder setDescription(java.lang.String value) { 760 if (value == null) { 761 throw new NullPointerException(); 762 } 763 description_ = value; 764 bitField0_ |= 0x00000001; 765 onChanged(); 766 return this; 767 } 768 /** 769 * 770 * 771 * <pre> 772 * An optional description of this resource. Provide this property when you create the resource. 773 * </pre> 774 * 775 * <code>optional string description = 422937596;</code> 776 * 777 * @return This builder for chaining. 778 */ clearDescription()779 public Builder clearDescription() { 780 description_ = getDefaultInstance().getDescription(); 781 bitField0_ = (bitField0_ & ~0x00000001); 782 onChanged(); 783 return this; 784 } 785 /** 786 * 787 * 788 * <pre> 789 * An optional description of this resource. Provide this property when you create the resource. 790 * </pre> 791 * 792 * <code>optional string description = 422937596;</code> 793 * 794 * @param value The bytes for description to set. 795 * @return This builder for chaining. 796 */ setDescriptionBytes(com.google.protobuf.ByteString value)797 public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { 798 if (value == null) { 799 throw new NullPointerException(); 800 } 801 checkByteStringIsUtf8(value); 802 description_ = value; 803 bitField0_ |= 0x00000001; 804 onChanged(); 805 return this; 806 } 807 808 private com.google.protobuf.LazyStringList hosts_ = 809 com.google.protobuf.LazyStringArrayList.EMPTY; 810 ensureHostsIsMutable()811 private void ensureHostsIsMutable() { 812 if (!((bitField0_ & 0x00000002) != 0)) { 813 hosts_ = new com.google.protobuf.LazyStringArrayList(hosts_); 814 bitField0_ |= 0x00000002; 815 } 816 } 817 /** 818 * 819 * 820 * <pre> 821 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 822 * </pre> 823 * 824 * <code>repeated string hosts = 99467211;</code> 825 * 826 * @return A list containing the hosts. 827 */ getHostsList()828 public com.google.protobuf.ProtocolStringList getHostsList() { 829 return hosts_.getUnmodifiableView(); 830 } 831 /** 832 * 833 * 834 * <pre> 835 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 836 * </pre> 837 * 838 * <code>repeated string hosts = 99467211;</code> 839 * 840 * @return The count of hosts. 841 */ getHostsCount()842 public int getHostsCount() { 843 return hosts_.size(); 844 } 845 /** 846 * 847 * 848 * <pre> 849 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 850 * </pre> 851 * 852 * <code>repeated string hosts = 99467211;</code> 853 * 854 * @param index The index of the element to return. 855 * @return The hosts at the given index. 856 */ getHosts(int index)857 public java.lang.String getHosts(int index) { 858 return hosts_.get(index); 859 } 860 /** 861 * 862 * 863 * <pre> 864 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 865 * </pre> 866 * 867 * <code>repeated string hosts = 99467211;</code> 868 * 869 * @param index The index of the value to return. 870 * @return The bytes of the hosts at the given index. 871 */ getHostsBytes(int index)872 public com.google.protobuf.ByteString getHostsBytes(int index) { 873 return hosts_.getByteString(index); 874 } 875 /** 876 * 877 * 878 * <pre> 879 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 880 * </pre> 881 * 882 * <code>repeated string hosts = 99467211;</code> 883 * 884 * @param index The index to set the value at. 885 * @param value The hosts to set. 886 * @return This builder for chaining. 887 */ setHosts(int index, java.lang.String value)888 public Builder setHosts(int index, java.lang.String value) { 889 if (value == null) { 890 throw new NullPointerException(); 891 } 892 ensureHostsIsMutable(); 893 hosts_.set(index, value); 894 onChanged(); 895 return this; 896 } 897 /** 898 * 899 * 900 * <pre> 901 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 902 * </pre> 903 * 904 * <code>repeated string hosts = 99467211;</code> 905 * 906 * @param value The hosts to add. 907 * @return This builder for chaining. 908 */ addHosts(java.lang.String value)909 public Builder addHosts(java.lang.String value) { 910 if (value == null) { 911 throw new NullPointerException(); 912 } 913 ensureHostsIsMutable(); 914 hosts_.add(value); 915 onChanged(); 916 return this; 917 } 918 /** 919 * 920 * 921 * <pre> 922 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 923 * </pre> 924 * 925 * <code>repeated string hosts = 99467211;</code> 926 * 927 * @param values The hosts to add. 928 * @return This builder for chaining. 929 */ addAllHosts(java.lang.Iterable<java.lang.String> values)930 public Builder addAllHosts(java.lang.Iterable<java.lang.String> values) { 931 ensureHostsIsMutable(); 932 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hosts_); 933 onChanged(); 934 return this; 935 } 936 /** 937 * 938 * 939 * <pre> 940 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 941 * </pre> 942 * 943 * <code>repeated string hosts = 99467211;</code> 944 * 945 * @return This builder for chaining. 946 */ clearHosts()947 public Builder clearHosts() { 948 hosts_ = com.google.protobuf.LazyStringArrayList.EMPTY; 949 bitField0_ = (bitField0_ & ~0x00000002); 950 onChanged(); 951 return this; 952 } 953 /** 954 * 955 * 956 * <pre> 957 * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. 958 * </pre> 959 * 960 * <code>repeated string hosts = 99467211;</code> 961 * 962 * @param value The bytes of the hosts to add. 963 * @return This builder for chaining. 964 */ addHostsBytes(com.google.protobuf.ByteString value)965 public Builder addHostsBytes(com.google.protobuf.ByteString value) { 966 if (value == null) { 967 throw new NullPointerException(); 968 } 969 checkByteStringIsUtf8(value); 970 ensureHostsIsMutable(); 971 hosts_.add(value); 972 onChanged(); 973 return this; 974 } 975 976 private java.lang.Object pathMatcher_ = ""; 977 /** 978 * 979 * 980 * <pre> 981 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 982 * </pre> 983 * 984 * <code>optional string path_matcher = 337813272;</code> 985 * 986 * @return Whether the pathMatcher field is set. 987 */ hasPathMatcher()988 public boolean hasPathMatcher() { 989 return ((bitField0_ & 0x00000004) != 0); 990 } 991 /** 992 * 993 * 994 * <pre> 995 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 996 * </pre> 997 * 998 * <code>optional string path_matcher = 337813272;</code> 999 * 1000 * @return The pathMatcher. 1001 */ getPathMatcher()1002 public java.lang.String getPathMatcher() { 1003 java.lang.Object ref = pathMatcher_; 1004 if (!(ref instanceof java.lang.String)) { 1005 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1006 java.lang.String s = bs.toStringUtf8(); 1007 pathMatcher_ = s; 1008 return s; 1009 } else { 1010 return (java.lang.String) ref; 1011 } 1012 } 1013 /** 1014 * 1015 * 1016 * <pre> 1017 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 1018 * </pre> 1019 * 1020 * <code>optional string path_matcher = 337813272;</code> 1021 * 1022 * @return The bytes for pathMatcher. 1023 */ getPathMatcherBytes()1024 public com.google.protobuf.ByteString getPathMatcherBytes() { 1025 java.lang.Object ref = pathMatcher_; 1026 if (ref instanceof String) { 1027 com.google.protobuf.ByteString b = 1028 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1029 pathMatcher_ = b; 1030 return b; 1031 } else { 1032 return (com.google.protobuf.ByteString) ref; 1033 } 1034 } 1035 /** 1036 * 1037 * 1038 * <pre> 1039 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 1040 * </pre> 1041 * 1042 * <code>optional string path_matcher = 337813272;</code> 1043 * 1044 * @param value The pathMatcher to set. 1045 * @return This builder for chaining. 1046 */ setPathMatcher(java.lang.String value)1047 public Builder setPathMatcher(java.lang.String value) { 1048 if (value == null) { 1049 throw new NullPointerException(); 1050 } 1051 pathMatcher_ = value; 1052 bitField0_ |= 0x00000004; 1053 onChanged(); 1054 return this; 1055 } 1056 /** 1057 * 1058 * 1059 * <pre> 1060 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 1061 * </pre> 1062 * 1063 * <code>optional string path_matcher = 337813272;</code> 1064 * 1065 * @return This builder for chaining. 1066 */ clearPathMatcher()1067 public Builder clearPathMatcher() { 1068 pathMatcher_ = getDefaultInstance().getPathMatcher(); 1069 bitField0_ = (bitField0_ & ~0x00000004); 1070 onChanged(); 1071 return this; 1072 } 1073 /** 1074 * 1075 * 1076 * <pre> 1077 * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. 1078 * </pre> 1079 * 1080 * <code>optional string path_matcher = 337813272;</code> 1081 * 1082 * @param value The bytes for pathMatcher to set. 1083 * @return This builder for chaining. 1084 */ setPathMatcherBytes(com.google.protobuf.ByteString value)1085 public Builder setPathMatcherBytes(com.google.protobuf.ByteString value) { 1086 if (value == null) { 1087 throw new NullPointerException(); 1088 } 1089 checkByteStringIsUtf8(value); 1090 pathMatcher_ = value; 1091 bitField0_ |= 0x00000004; 1092 onChanged(); 1093 return this; 1094 } 1095 1096 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1097 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1098 return super.setUnknownFields(unknownFields); 1099 } 1100 1101 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1102 public final Builder mergeUnknownFields( 1103 final com.google.protobuf.UnknownFieldSet unknownFields) { 1104 return super.mergeUnknownFields(unknownFields); 1105 } 1106 1107 // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.HostRule) 1108 } 1109 1110 // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.HostRule) 1111 private static final com.google.cloud.compute.v1.HostRule DEFAULT_INSTANCE; 1112 1113 static { 1114 DEFAULT_INSTANCE = new com.google.cloud.compute.v1.HostRule(); 1115 } 1116 getDefaultInstance()1117 public static com.google.cloud.compute.v1.HostRule getDefaultInstance() { 1118 return DEFAULT_INSTANCE; 1119 } 1120 1121 private static final com.google.protobuf.Parser<HostRule> PARSER = 1122 new com.google.protobuf.AbstractParser<HostRule>() { 1123 @java.lang.Override 1124 public HostRule parsePartialFrom( 1125 com.google.protobuf.CodedInputStream input, 1126 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1127 throws com.google.protobuf.InvalidProtocolBufferException { 1128 Builder builder = newBuilder(); 1129 try { 1130 builder.mergeFrom(input, extensionRegistry); 1131 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1132 throw e.setUnfinishedMessage(builder.buildPartial()); 1133 } catch (com.google.protobuf.UninitializedMessageException e) { 1134 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1135 } catch (java.io.IOException e) { 1136 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1137 .setUnfinishedMessage(builder.buildPartial()); 1138 } 1139 return builder.buildPartial(); 1140 } 1141 }; 1142 parser()1143 public static com.google.protobuf.Parser<HostRule> parser() { 1144 return PARSER; 1145 } 1146 1147 @java.lang.Override getParserForType()1148 public com.google.protobuf.Parser<HostRule> getParserForType() { 1149 return PARSER; 1150 } 1151 1152 @java.lang.Override getDefaultInstanceForType()1153 public com.google.cloud.compute.v1.HostRule getDefaultInstanceForType() { 1154 return DEFAULT_INSTANCE; 1155 } 1156 } 1157