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 * A routing configuration attached to a network resource. The message includes the list of routers associated with the network, and a flag indicating the type of routing behavior to enforce network-wide. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.compute.v1.NetworkRoutingConfig} 29 */ 30 public final class NetworkRoutingConfig extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.NetworkRoutingConfig) 33 NetworkRoutingConfigOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use NetworkRoutingConfig.newBuilder() to construct. NetworkRoutingConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private NetworkRoutingConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 NetworkRoutingConfig()40 private NetworkRoutingConfig() { 41 routingMode_ = ""; 42 } 43 44 @java.lang.Override 45 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)46 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 47 return new NetworkRoutingConfig(); 48 } 49 50 @java.lang.Override getUnknownFields()51 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 52 return this.unknownFields; 53 } 54 getDescriptor()55 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 56 return com.google.cloud.compute.v1.Compute 57 .internal_static_google_cloud_compute_v1_NetworkRoutingConfig_descriptor; 58 } 59 60 @java.lang.Override 61 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()62 internalGetFieldAccessorTable() { 63 return com.google.cloud.compute.v1.Compute 64 .internal_static_google_cloud_compute_v1_NetworkRoutingConfig_fieldAccessorTable 65 .ensureFieldAccessorsInitialized( 66 com.google.cloud.compute.v1.NetworkRoutingConfig.class, 67 com.google.cloud.compute.v1.NetworkRoutingConfig.Builder.class); 68 } 69 70 /** 71 * 72 * 73 * <pre> 74 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 75 * </pre> 76 * 77 * Protobuf enum {@code google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode} 78 */ 79 public enum RoutingMode implements com.google.protobuf.ProtocolMessageEnum { 80 /** 81 * 82 * 83 * <pre> 84 * A value indicating that the enum field is not set. 85 * </pre> 86 * 87 * <code>UNDEFINED_ROUTING_MODE = 0;</code> 88 */ 89 UNDEFINED_ROUTING_MODE(0), 90 /** <code>GLOBAL = 494663587;</code> */ 91 GLOBAL(494663587), 92 /** <code>REGIONAL = 92288543;</code> */ 93 REGIONAL(92288543), 94 UNRECOGNIZED(-1), 95 ; 96 97 /** 98 * 99 * 100 * <pre> 101 * A value indicating that the enum field is not set. 102 * </pre> 103 * 104 * <code>UNDEFINED_ROUTING_MODE = 0;</code> 105 */ 106 public static final int UNDEFINED_ROUTING_MODE_VALUE = 0; 107 /** <code>GLOBAL = 494663587;</code> */ 108 public static final int GLOBAL_VALUE = 494663587; 109 /** <code>REGIONAL = 92288543;</code> */ 110 public static final int REGIONAL_VALUE = 92288543; 111 getNumber()112 public final int getNumber() { 113 if (this == UNRECOGNIZED) { 114 throw new java.lang.IllegalArgumentException( 115 "Can't get the number of an unknown enum value."); 116 } 117 return value; 118 } 119 120 /** 121 * @param value The numeric wire value of the corresponding enum entry. 122 * @return The enum associated with the given numeric wire value. 123 * @deprecated Use {@link #forNumber(int)} instead. 124 */ 125 @java.lang.Deprecated valueOf(int value)126 public static RoutingMode valueOf(int value) { 127 return forNumber(value); 128 } 129 130 /** 131 * @param value The numeric wire value of the corresponding enum entry. 132 * @return The enum associated with the given numeric wire value. 133 */ forNumber(int value)134 public static RoutingMode forNumber(int value) { 135 switch (value) { 136 case 0: 137 return UNDEFINED_ROUTING_MODE; 138 case 494663587: 139 return GLOBAL; 140 case 92288543: 141 return REGIONAL; 142 default: 143 return null; 144 } 145 } 146 internalGetValueMap()147 public static com.google.protobuf.Internal.EnumLiteMap<RoutingMode> internalGetValueMap() { 148 return internalValueMap; 149 } 150 151 private static final com.google.protobuf.Internal.EnumLiteMap<RoutingMode> internalValueMap = 152 new com.google.protobuf.Internal.EnumLiteMap<RoutingMode>() { 153 public RoutingMode findValueByNumber(int number) { 154 return RoutingMode.forNumber(number); 155 } 156 }; 157 getValueDescriptor()158 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 159 if (this == UNRECOGNIZED) { 160 throw new java.lang.IllegalStateException( 161 "Can't get the descriptor of an unrecognized enum value."); 162 } 163 return getDescriptor().getValues().get(ordinal()); 164 } 165 getDescriptorForType()166 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 167 return getDescriptor(); 168 } 169 getDescriptor()170 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 171 return com.google.cloud.compute.v1.NetworkRoutingConfig.getDescriptor().getEnumTypes().get(0); 172 } 173 174 private static final RoutingMode[] VALUES = values(); 175 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)176 public static RoutingMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 177 if (desc.getType() != getDescriptor()) { 178 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 179 } 180 if (desc.getIndex() == -1) { 181 return UNRECOGNIZED; 182 } 183 return VALUES[desc.getIndex()]; 184 } 185 186 private final int value; 187 RoutingMode(int value)188 private RoutingMode(int value) { 189 this.value = value; 190 } 191 192 // @@protoc_insertion_point(enum_scope:google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode) 193 } 194 195 private int bitField0_; 196 public static final int ROUTING_MODE_FIELD_NUMBER = 475143548; 197 198 @SuppressWarnings("serial") 199 private volatile java.lang.Object routingMode_ = ""; 200 /** 201 * 202 * 203 * <pre> 204 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 205 * Check the RoutingMode enum for the list of possible values. 206 * </pre> 207 * 208 * <code>optional string routing_mode = 475143548;</code> 209 * 210 * @return Whether the routingMode field is set. 211 */ 212 @java.lang.Override hasRoutingMode()213 public boolean hasRoutingMode() { 214 return ((bitField0_ & 0x00000001) != 0); 215 } 216 /** 217 * 218 * 219 * <pre> 220 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 221 * Check the RoutingMode enum for the list of possible values. 222 * </pre> 223 * 224 * <code>optional string routing_mode = 475143548;</code> 225 * 226 * @return The routingMode. 227 */ 228 @java.lang.Override getRoutingMode()229 public java.lang.String getRoutingMode() { 230 java.lang.Object ref = routingMode_; 231 if (ref instanceof java.lang.String) { 232 return (java.lang.String) ref; 233 } else { 234 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 235 java.lang.String s = bs.toStringUtf8(); 236 routingMode_ = s; 237 return s; 238 } 239 } 240 /** 241 * 242 * 243 * <pre> 244 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 245 * Check the RoutingMode enum for the list of possible values. 246 * </pre> 247 * 248 * <code>optional string routing_mode = 475143548;</code> 249 * 250 * @return The bytes for routingMode. 251 */ 252 @java.lang.Override getRoutingModeBytes()253 public com.google.protobuf.ByteString getRoutingModeBytes() { 254 java.lang.Object ref = routingMode_; 255 if (ref instanceof java.lang.String) { 256 com.google.protobuf.ByteString b = 257 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 258 routingMode_ = b; 259 return b; 260 } else { 261 return (com.google.protobuf.ByteString) ref; 262 } 263 } 264 265 private byte memoizedIsInitialized = -1; 266 267 @java.lang.Override isInitialized()268 public final boolean isInitialized() { 269 byte isInitialized = memoizedIsInitialized; 270 if (isInitialized == 1) return true; 271 if (isInitialized == 0) return false; 272 273 memoizedIsInitialized = 1; 274 return true; 275 } 276 277 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)278 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 279 if (((bitField0_ & 0x00000001) != 0)) { 280 com.google.protobuf.GeneratedMessageV3.writeString(output, 475143548, routingMode_); 281 } 282 getUnknownFields().writeTo(output); 283 } 284 285 @java.lang.Override getSerializedSize()286 public int getSerializedSize() { 287 int size = memoizedSize; 288 if (size != -1) return size; 289 290 size = 0; 291 if (((bitField0_ & 0x00000001) != 0)) { 292 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(475143548, routingMode_); 293 } 294 size += getUnknownFields().getSerializedSize(); 295 memoizedSize = size; 296 return size; 297 } 298 299 @java.lang.Override equals(final java.lang.Object obj)300 public boolean equals(final java.lang.Object obj) { 301 if (obj == this) { 302 return true; 303 } 304 if (!(obj instanceof com.google.cloud.compute.v1.NetworkRoutingConfig)) { 305 return super.equals(obj); 306 } 307 com.google.cloud.compute.v1.NetworkRoutingConfig other = 308 (com.google.cloud.compute.v1.NetworkRoutingConfig) obj; 309 310 if (hasRoutingMode() != other.hasRoutingMode()) return false; 311 if (hasRoutingMode()) { 312 if (!getRoutingMode().equals(other.getRoutingMode())) return false; 313 } 314 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 315 return true; 316 } 317 318 @java.lang.Override hashCode()319 public int hashCode() { 320 if (memoizedHashCode != 0) { 321 return memoizedHashCode; 322 } 323 int hash = 41; 324 hash = (19 * hash) + getDescriptor().hashCode(); 325 if (hasRoutingMode()) { 326 hash = (37 * hash) + ROUTING_MODE_FIELD_NUMBER; 327 hash = (53 * hash) + getRoutingMode().hashCode(); 328 } 329 hash = (29 * hash) + getUnknownFields().hashCode(); 330 memoizedHashCode = hash; 331 return hash; 332 } 333 parseFrom(java.nio.ByteBuffer data)334 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom(java.nio.ByteBuffer data) 335 throws com.google.protobuf.InvalidProtocolBufferException { 336 return PARSER.parseFrom(data); 337 } 338 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)339 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom( 340 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 341 throws com.google.protobuf.InvalidProtocolBufferException { 342 return PARSER.parseFrom(data, extensionRegistry); 343 } 344 parseFrom( com.google.protobuf.ByteString data)345 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom( 346 com.google.protobuf.ByteString data) 347 throws com.google.protobuf.InvalidProtocolBufferException { 348 return PARSER.parseFrom(data); 349 } 350 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)351 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom( 352 com.google.protobuf.ByteString data, 353 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 354 throws com.google.protobuf.InvalidProtocolBufferException { 355 return PARSER.parseFrom(data, extensionRegistry); 356 } 357 parseFrom(byte[] data)358 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom(byte[] data) 359 throws com.google.protobuf.InvalidProtocolBufferException { 360 return PARSER.parseFrom(data); 361 } 362 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)363 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom( 364 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 365 throws com.google.protobuf.InvalidProtocolBufferException { 366 return PARSER.parseFrom(data, extensionRegistry); 367 } 368 parseFrom( java.io.InputStream input)369 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom( 370 java.io.InputStream input) throws java.io.IOException { 371 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 372 } 373 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)374 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom( 375 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 376 throws java.io.IOException { 377 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 378 PARSER, input, extensionRegistry); 379 } 380 parseDelimitedFrom( java.io.InputStream input)381 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseDelimitedFrom( 382 java.io.InputStream input) throws java.io.IOException { 383 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 384 } 385 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)386 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseDelimitedFrom( 387 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 388 throws java.io.IOException { 389 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 390 PARSER, input, extensionRegistry); 391 } 392 parseFrom( com.google.protobuf.CodedInputStream input)393 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom( 394 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 395 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 396 } 397 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)398 public static com.google.cloud.compute.v1.NetworkRoutingConfig parseFrom( 399 com.google.protobuf.CodedInputStream input, 400 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 401 throws java.io.IOException { 402 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 403 PARSER, input, extensionRegistry); 404 } 405 406 @java.lang.Override newBuilderForType()407 public Builder newBuilderForType() { 408 return newBuilder(); 409 } 410 newBuilder()411 public static Builder newBuilder() { 412 return DEFAULT_INSTANCE.toBuilder(); 413 } 414 newBuilder(com.google.cloud.compute.v1.NetworkRoutingConfig prototype)415 public static Builder newBuilder(com.google.cloud.compute.v1.NetworkRoutingConfig prototype) { 416 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 417 } 418 419 @java.lang.Override toBuilder()420 public Builder toBuilder() { 421 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 422 } 423 424 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)425 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 426 Builder builder = new Builder(parent); 427 return builder; 428 } 429 /** 430 * 431 * 432 * <pre> 433 * A routing configuration attached to a network resource. The message includes the list of routers associated with the network, and a flag indicating the type of routing behavior to enforce network-wide. 434 * </pre> 435 * 436 * Protobuf type {@code google.cloud.compute.v1.NetworkRoutingConfig} 437 */ 438 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 439 implements 440 // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.NetworkRoutingConfig) 441 com.google.cloud.compute.v1.NetworkRoutingConfigOrBuilder { getDescriptor()442 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 443 return com.google.cloud.compute.v1.Compute 444 .internal_static_google_cloud_compute_v1_NetworkRoutingConfig_descriptor; 445 } 446 447 @java.lang.Override 448 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()449 internalGetFieldAccessorTable() { 450 return com.google.cloud.compute.v1.Compute 451 .internal_static_google_cloud_compute_v1_NetworkRoutingConfig_fieldAccessorTable 452 .ensureFieldAccessorsInitialized( 453 com.google.cloud.compute.v1.NetworkRoutingConfig.class, 454 com.google.cloud.compute.v1.NetworkRoutingConfig.Builder.class); 455 } 456 457 // Construct using com.google.cloud.compute.v1.NetworkRoutingConfig.newBuilder() Builder()458 private Builder() {} 459 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)460 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 461 super(parent); 462 } 463 464 @java.lang.Override clear()465 public Builder clear() { 466 super.clear(); 467 bitField0_ = 0; 468 routingMode_ = ""; 469 return this; 470 } 471 472 @java.lang.Override getDescriptorForType()473 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 474 return com.google.cloud.compute.v1.Compute 475 .internal_static_google_cloud_compute_v1_NetworkRoutingConfig_descriptor; 476 } 477 478 @java.lang.Override getDefaultInstanceForType()479 public com.google.cloud.compute.v1.NetworkRoutingConfig getDefaultInstanceForType() { 480 return com.google.cloud.compute.v1.NetworkRoutingConfig.getDefaultInstance(); 481 } 482 483 @java.lang.Override build()484 public com.google.cloud.compute.v1.NetworkRoutingConfig build() { 485 com.google.cloud.compute.v1.NetworkRoutingConfig result = buildPartial(); 486 if (!result.isInitialized()) { 487 throw newUninitializedMessageException(result); 488 } 489 return result; 490 } 491 492 @java.lang.Override buildPartial()493 public com.google.cloud.compute.v1.NetworkRoutingConfig buildPartial() { 494 com.google.cloud.compute.v1.NetworkRoutingConfig result = 495 new com.google.cloud.compute.v1.NetworkRoutingConfig(this); 496 if (bitField0_ != 0) { 497 buildPartial0(result); 498 } 499 onBuilt(); 500 return result; 501 } 502 buildPartial0(com.google.cloud.compute.v1.NetworkRoutingConfig result)503 private void buildPartial0(com.google.cloud.compute.v1.NetworkRoutingConfig result) { 504 int from_bitField0_ = bitField0_; 505 int to_bitField0_ = 0; 506 if (((from_bitField0_ & 0x00000001) != 0)) { 507 result.routingMode_ = routingMode_; 508 to_bitField0_ |= 0x00000001; 509 } 510 result.bitField0_ |= to_bitField0_; 511 } 512 513 @java.lang.Override clone()514 public Builder clone() { 515 return super.clone(); 516 } 517 518 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)519 public Builder setField( 520 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 521 return super.setField(field, value); 522 } 523 524 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)525 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 526 return super.clearField(field); 527 } 528 529 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)530 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 531 return super.clearOneof(oneof); 532 } 533 534 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)535 public Builder setRepeatedField( 536 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 537 return super.setRepeatedField(field, index, value); 538 } 539 540 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)541 public Builder addRepeatedField( 542 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 543 return super.addRepeatedField(field, value); 544 } 545 546 @java.lang.Override mergeFrom(com.google.protobuf.Message other)547 public Builder mergeFrom(com.google.protobuf.Message other) { 548 if (other instanceof com.google.cloud.compute.v1.NetworkRoutingConfig) { 549 return mergeFrom((com.google.cloud.compute.v1.NetworkRoutingConfig) other); 550 } else { 551 super.mergeFrom(other); 552 return this; 553 } 554 } 555 mergeFrom(com.google.cloud.compute.v1.NetworkRoutingConfig other)556 public Builder mergeFrom(com.google.cloud.compute.v1.NetworkRoutingConfig other) { 557 if (other == com.google.cloud.compute.v1.NetworkRoutingConfig.getDefaultInstance()) 558 return this; 559 if (other.hasRoutingMode()) { 560 routingMode_ = other.routingMode_; 561 bitField0_ |= 0x00000001; 562 onChanged(); 563 } 564 this.mergeUnknownFields(other.getUnknownFields()); 565 onChanged(); 566 return this; 567 } 568 569 @java.lang.Override isInitialized()570 public final boolean isInitialized() { 571 return true; 572 } 573 574 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)575 public Builder mergeFrom( 576 com.google.protobuf.CodedInputStream input, 577 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 578 throws java.io.IOException { 579 if (extensionRegistry == null) { 580 throw new java.lang.NullPointerException(); 581 } 582 try { 583 boolean done = false; 584 while (!done) { 585 int tag = input.readTag(); 586 switch (tag) { 587 case 0: 588 done = true; 589 break; 590 case -493818910: 591 { 592 routingMode_ = input.readStringRequireUtf8(); 593 bitField0_ |= 0x00000001; 594 break; 595 } // case -493818910 596 default: 597 { 598 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 599 done = true; // was an endgroup tag 600 } 601 break; 602 } // default: 603 } // switch (tag) 604 } // while (!done) 605 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 606 throw e.unwrapIOException(); 607 } finally { 608 onChanged(); 609 } // finally 610 return this; 611 } 612 613 private int bitField0_; 614 615 private java.lang.Object routingMode_ = ""; 616 /** 617 * 618 * 619 * <pre> 620 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 621 * Check the RoutingMode enum for the list of possible values. 622 * </pre> 623 * 624 * <code>optional string routing_mode = 475143548;</code> 625 * 626 * @return Whether the routingMode field is set. 627 */ hasRoutingMode()628 public boolean hasRoutingMode() { 629 return ((bitField0_ & 0x00000001) != 0); 630 } 631 /** 632 * 633 * 634 * <pre> 635 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 636 * Check the RoutingMode enum for the list of possible values. 637 * </pre> 638 * 639 * <code>optional string routing_mode = 475143548;</code> 640 * 641 * @return The routingMode. 642 */ getRoutingMode()643 public java.lang.String getRoutingMode() { 644 java.lang.Object ref = routingMode_; 645 if (!(ref instanceof java.lang.String)) { 646 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 647 java.lang.String s = bs.toStringUtf8(); 648 routingMode_ = s; 649 return s; 650 } else { 651 return (java.lang.String) ref; 652 } 653 } 654 /** 655 * 656 * 657 * <pre> 658 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 659 * Check the RoutingMode enum for the list of possible values. 660 * </pre> 661 * 662 * <code>optional string routing_mode = 475143548;</code> 663 * 664 * @return The bytes for routingMode. 665 */ getRoutingModeBytes()666 public com.google.protobuf.ByteString getRoutingModeBytes() { 667 java.lang.Object ref = routingMode_; 668 if (ref instanceof String) { 669 com.google.protobuf.ByteString b = 670 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 671 routingMode_ = b; 672 return b; 673 } else { 674 return (com.google.protobuf.ByteString) ref; 675 } 676 } 677 /** 678 * 679 * 680 * <pre> 681 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 682 * Check the RoutingMode enum for the list of possible values. 683 * </pre> 684 * 685 * <code>optional string routing_mode = 475143548;</code> 686 * 687 * @param value The routingMode to set. 688 * @return This builder for chaining. 689 */ setRoutingMode(java.lang.String value)690 public Builder setRoutingMode(java.lang.String value) { 691 if (value == null) { 692 throw new NullPointerException(); 693 } 694 routingMode_ = value; 695 bitField0_ |= 0x00000001; 696 onChanged(); 697 return this; 698 } 699 /** 700 * 701 * 702 * <pre> 703 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 704 * Check the RoutingMode enum for the list of possible values. 705 * </pre> 706 * 707 * <code>optional string routing_mode = 475143548;</code> 708 * 709 * @return This builder for chaining. 710 */ clearRoutingMode()711 public Builder clearRoutingMode() { 712 routingMode_ = getDefaultInstance().getRoutingMode(); 713 bitField0_ = (bitField0_ & ~0x00000001); 714 onChanged(); 715 return this; 716 } 717 /** 718 * 719 * 720 * <pre> 721 * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. 722 * Check the RoutingMode enum for the list of possible values. 723 * </pre> 724 * 725 * <code>optional string routing_mode = 475143548;</code> 726 * 727 * @param value The bytes for routingMode to set. 728 * @return This builder for chaining. 729 */ setRoutingModeBytes(com.google.protobuf.ByteString value)730 public Builder setRoutingModeBytes(com.google.protobuf.ByteString value) { 731 if (value == null) { 732 throw new NullPointerException(); 733 } 734 checkByteStringIsUtf8(value); 735 routingMode_ = value; 736 bitField0_ |= 0x00000001; 737 onChanged(); 738 return this; 739 } 740 741 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)742 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 743 return super.setUnknownFields(unknownFields); 744 } 745 746 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)747 public final Builder mergeUnknownFields( 748 final com.google.protobuf.UnknownFieldSet unknownFields) { 749 return super.mergeUnknownFields(unknownFields); 750 } 751 752 // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.NetworkRoutingConfig) 753 } 754 755 // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.NetworkRoutingConfig) 756 private static final com.google.cloud.compute.v1.NetworkRoutingConfig DEFAULT_INSTANCE; 757 758 static { 759 DEFAULT_INSTANCE = new com.google.cloud.compute.v1.NetworkRoutingConfig(); 760 } 761 getDefaultInstance()762 public static com.google.cloud.compute.v1.NetworkRoutingConfig getDefaultInstance() { 763 return DEFAULT_INSTANCE; 764 } 765 766 private static final com.google.protobuf.Parser<NetworkRoutingConfig> PARSER = 767 new com.google.protobuf.AbstractParser<NetworkRoutingConfig>() { 768 @java.lang.Override 769 public NetworkRoutingConfig parsePartialFrom( 770 com.google.protobuf.CodedInputStream input, 771 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 772 throws com.google.protobuf.InvalidProtocolBufferException { 773 Builder builder = newBuilder(); 774 try { 775 builder.mergeFrom(input, extensionRegistry); 776 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 777 throw e.setUnfinishedMessage(builder.buildPartial()); 778 } catch (com.google.protobuf.UninitializedMessageException e) { 779 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 780 } catch (java.io.IOException e) { 781 throw new com.google.protobuf.InvalidProtocolBufferException(e) 782 .setUnfinishedMessage(builder.buildPartial()); 783 } 784 return builder.buildPartial(); 785 } 786 }; 787 parser()788 public static com.google.protobuf.Parser<NetworkRoutingConfig> parser() { 789 return PARSER; 790 } 791 792 @java.lang.Override getParserForType()793 public com.google.protobuf.Parser<NetworkRoutingConfig> getParserForType() { 794 return PARSER; 795 } 796 797 @java.lang.Override getDefaultInstanceForType()798 public com.google.cloud.compute.v1.NetworkRoutingConfig getDefaultInstanceForType() { 799 return DEFAULT_INSTANCE; 800 } 801 } 802