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 * The network endpoint. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.compute.v1.NetworkEndpoint} 29 */ 30 public final class NetworkEndpoint extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.NetworkEndpoint) 33 NetworkEndpointOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use NetworkEndpoint.newBuilder() to construct. NetworkEndpoint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private NetworkEndpoint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 NetworkEndpoint()40 private NetworkEndpoint() { 41 fqdn_ = ""; 42 instance_ = ""; 43 ipAddress_ = ""; 44 } 45 46 @java.lang.Override 47 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)48 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 49 return new NetworkEndpoint(); 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_NetworkEndpoint_descriptor; 60 } 61 62 @SuppressWarnings({"rawtypes"}) 63 @java.lang.Override internalGetMapField(int number)64 protected com.google.protobuf.MapField internalGetMapField(int number) { 65 switch (number) { 66 case 112032548: 67 return internalGetAnnotations(); 68 default: 69 throw new RuntimeException("Invalid map field number: " + number); 70 } 71 } 72 73 @java.lang.Override 74 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()75 internalGetFieldAccessorTable() { 76 return com.google.cloud.compute.v1.Compute 77 .internal_static_google_cloud_compute_v1_NetworkEndpoint_fieldAccessorTable 78 .ensureFieldAccessorsInitialized( 79 com.google.cloud.compute.v1.NetworkEndpoint.class, 80 com.google.cloud.compute.v1.NetworkEndpoint.Builder.class); 81 } 82 83 private int bitField0_; 84 public static final int ANNOTATIONS_FIELD_NUMBER = 112032548; 85 86 private static final class AnnotationsDefaultEntryHolder { 87 static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = 88 com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance( 89 com.google.cloud.compute.v1.Compute 90 .internal_static_google_cloud_compute_v1_NetworkEndpoint_AnnotationsEntry_descriptor, 91 com.google.protobuf.WireFormat.FieldType.STRING, 92 "", 93 com.google.protobuf.WireFormat.FieldType.STRING, 94 ""); 95 } 96 97 @SuppressWarnings("serial") 98 private com.google.protobuf.MapField<java.lang.String, java.lang.String> annotations_; 99 100 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetAnnotations()101 internalGetAnnotations() { 102 if (annotations_ == null) { 103 return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); 104 } 105 return annotations_; 106 } 107 getAnnotationsCount()108 public int getAnnotationsCount() { 109 return internalGetAnnotations().getMap().size(); 110 } 111 /** 112 * 113 * 114 * <pre> 115 * Metadata defined as annotations on the network endpoint. 116 * </pre> 117 * 118 * <code>map<string, string> annotations = 112032548;</code> 119 */ 120 @java.lang.Override containsAnnotations(java.lang.String key)121 public boolean containsAnnotations(java.lang.String key) { 122 if (key == null) { 123 throw new NullPointerException("map key"); 124 } 125 return internalGetAnnotations().getMap().containsKey(key); 126 } 127 /** Use {@link #getAnnotationsMap()} instead. */ 128 @java.lang.Override 129 @java.lang.Deprecated getAnnotations()130 public java.util.Map<java.lang.String, java.lang.String> getAnnotations() { 131 return getAnnotationsMap(); 132 } 133 /** 134 * 135 * 136 * <pre> 137 * Metadata defined as annotations on the network endpoint. 138 * </pre> 139 * 140 * <code>map<string, string> annotations = 112032548;</code> 141 */ 142 @java.lang.Override getAnnotationsMap()143 public java.util.Map<java.lang.String, java.lang.String> getAnnotationsMap() { 144 return internalGetAnnotations().getMap(); 145 } 146 /** 147 * 148 * 149 * <pre> 150 * Metadata defined as annotations on the network endpoint. 151 * </pre> 152 * 153 * <code>map<string, string> annotations = 112032548;</code> 154 */ 155 @java.lang.Override getAnnotationsOrDefault( java.lang.String key, java.lang.String defaultValue)156 public /* nullable */ java.lang.String getAnnotationsOrDefault( 157 java.lang.String key, 158 /* nullable */ 159 java.lang.String defaultValue) { 160 if (key == null) { 161 throw new NullPointerException("map key"); 162 } 163 java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap(); 164 return map.containsKey(key) ? map.get(key) : defaultValue; 165 } 166 /** 167 * 168 * 169 * <pre> 170 * Metadata defined as annotations on the network endpoint. 171 * </pre> 172 * 173 * <code>map<string, string> annotations = 112032548;</code> 174 */ 175 @java.lang.Override getAnnotationsOrThrow(java.lang.String key)176 public java.lang.String getAnnotationsOrThrow(java.lang.String key) { 177 if (key == null) { 178 throw new NullPointerException("map key"); 179 } 180 java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap(); 181 if (!map.containsKey(key)) { 182 throw new java.lang.IllegalArgumentException(); 183 } 184 return map.get(key); 185 } 186 187 public static final int FQDN_FIELD_NUMBER = 3150485; 188 189 @SuppressWarnings("serial") 190 private volatile java.lang.Object fqdn_ = ""; 191 /** 192 * 193 * 194 * <pre> 195 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 196 * </pre> 197 * 198 * <code>optional string fqdn = 3150485;</code> 199 * 200 * @return Whether the fqdn field is set. 201 */ 202 @java.lang.Override hasFqdn()203 public boolean hasFqdn() { 204 return ((bitField0_ & 0x00000001) != 0); 205 } 206 /** 207 * 208 * 209 * <pre> 210 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 211 * </pre> 212 * 213 * <code>optional string fqdn = 3150485;</code> 214 * 215 * @return The fqdn. 216 */ 217 @java.lang.Override getFqdn()218 public java.lang.String getFqdn() { 219 java.lang.Object ref = fqdn_; 220 if (ref instanceof java.lang.String) { 221 return (java.lang.String) ref; 222 } else { 223 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 224 java.lang.String s = bs.toStringUtf8(); 225 fqdn_ = s; 226 return s; 227 } 228 } 229 /** 230 * 231 * 232 * <pre> 233 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 234 * </pre> 235 * 236 * <code>optional string fqdn = 3150485;</code> 237 * 238 * @return The bytes for fqdn. 239 */ 240 @java.lang.Override getFqdnBytes()241 public com.google.protobuf.ByteString getFqdnBytes() { 242 java.lang.Object ref = fqdn_; 243 if (ref instanceof java.lang.String) { 244 com.google.protobuf.ByteString b = 245 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 246 fqdn_ = b; 247 return b; 248 } else { 249 return (com.google.protobuf.ByteString) ref; 250 } 251 } 252 253 public static final int INSTANCE_FIELD_NUMBER = 18257045; 254 255 @SuppressWarnings("serial") 256 private volatile java.lang.Object instance_ = ""; 257 /** 258 * 259 * 260 * <pre> 261 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 262 * </pre> 263 * 264 * <code>optional string instance = 18257045;</code> 265 * 266 * @return Whether the instance field is set. 267 */ 268 @java.lang.Override hasInstance()269 public boolean hasInstance() { 270 return ((bitField0_ & 0x00000002) != 0); 271 } 272 /** 273 * 274 * 275 * <pre> 276 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 277 * </pre> 278 * 279 * <code>optional string instance = 18257045;</code> 280 * 281 * @return The instance. 282 */ 283 @java.lang.Override getInstance()284 public java.lang.String getInstance() { 285 java.lang.Object ref = instance_; 286 if (ref instanceof java.lang.String) { 287 return (java.lang.String) ref; 288 } else { 289 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 290 java.lang.String s = bs.toStringUtf8(); 291 instance_ = s; 292 return s; 293 } 294 } 295 /** 296 * 297 * 298 * <pre> 299 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 300 * </pre> 301 * 302 * <code>optional string instance = 18257045;</code> 303 * 304 * @return The bytes for instance. 305 */ 306 @java.lang.Override getInstanceBytes()307 public com.google.protobuf.ByteString getInstanceBytes() { 308 java.lang.Object ref = instance_; 309 if (ref instanceof java.lang.String) { 310 com.google.protobuf.ByteString b = 311 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 312 instance_ = b; 313 return b; 314 } else { 315 return (com.google.protobuf.ByteString) ref; 316 } 317 } 318 319 public static final int IP_ADDRESS_FIELD_NUMBER = 406272220; 320 321 @SuppressWarnings("serial") 322 private volatile java.lang.Object ipAddress_ = ""; 323 /** 324 * 325 * 326 * <pre> 327 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 328 * </pre> 329 * 330 * <code>optional string ip_address = 406272220;</code> 331 * 332 * @return Whether the ipAddress field is set. 333 */ 334 @java.lang.Override hasIpAddress()335 public boolean hasIpAddress() { 336 return ((bitField0_ & 0x00000004) != 0); 337 } 338 /** 339 * 340 * 341 * <pre> 342 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 343 * </pre> 344 * 345 * <code>optional string ip_address = 406272220;</code> 346 * 347 * @return The ipAddress. 348 */ 349 @java.lang.Override getIpAddress()350 public java.lang.String getIpAddress() { 351 java.lang.Object ref = ipAddress_; 352 if (ref instanceof java.lang.String) { 353 return (java.lang.String) ref; 354 } else { 355 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 356 java.lang.String s = bs.toStringUtf8(); 357 ipAddress_ = s; 358 return s; 359 } 360 } 361 /** 362 * 363 * 364 * <pre> 365 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 366 * </pre> 367 * 368 * <code>optional string ip_address = 406272220;</code> 369 * 370 * @return The bytes for ipAddress. 371 */ 372 @java.lang.Override getIpAddressBytes()373 public com.google.protobuf.ByteString getIpAddressBytes() { 374 java.lang.Object ref = ipAddress_; 375 if (ref instanceof java.lang.String) { 376 com.google.protobuf.ByteString b = 377 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 378 ipAddress_ = b; 379 return b; 380 } else { 381 return (com.google.protobuf.ByteString) ref; 382 } 383 } 384 385 public static final int PORT_FIELD_NUMBER = 3446913; 386 private int port_ = 0; 387 /** 388 * 389 * 390 * <pre> 391 * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. 392 * </pre> 393 * 394 * <code>optional int32 port = 3446913;</code> 395 * 396 * @return Whether the port field is set. 397 */ 398 @java.lang.Override hasPort()399 public boolean hasPort() { 400 return ((bitField0_ & 0x00000008) != 0); 401 } 402 /** 403 * 404 * 405 * <pre> 406 * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. 407 * </pre> 408 * 409 * <code>optional int32 port = 3446913;</code> 410 * 411 * @return The port. 412 */ 413 @java.lang.Override getPort()414 public int getPort() { 415 return port_; 416 } 417 418 private byte memoizedIsInitialized = -1; 419 420 @java.lang.Override isInitialized()421 public final boolean isInitialized() { 422 byte isInitialized = memoizedIsInitialized; 423 if (isInitialized == 1) return true; 424 if (isInitialized == 0) return false; 425 426 memoizedIsInitialized = 1; 427 return true; 428 } 429 430 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)431 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 432 if (((bitField0_ & 0x00000001) != 0)) { 433 com.google.protobuf.GeneratedMessageV3.writeString(output, 3150485, fqdn_); 434 } 435 if (((bitField0_ & 0x00000008) != 0)) { 436 output.writeInt32(3446913, port_); 437 } 438 if (((bitField0_ & 0x00000002) != 0)) { 439 com.google.protobuf.GeneratedMessageV3.writeString(output, 18257045, instance_); 440 } 441 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 442 output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 112032548); 443 if (((bitField0_ & 0x00000004) != 0)) { 444 com.google.protobuf.GeneratedMessageV3.writeString(output, 406272220, ipAddress_); 445 } 446 getUnknownFields().writeTo(output); 447 } 448 449 @java.lang.Override getSerializedSize()450 public int getSerializedSize() { 451 int size = memoizedSize; 452 if (size != -1) return size; 453 454 size = 0; 455 if (((bitField0_ & 0x00000001) != 0)) { 456 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3150485, fqdn_); 457 } 458 if (((bitField0_ & 0x00000008) != 0)) { 459 size += com.google.protobuf.CodedOutputStream.computeInt32Size(3446913, port_); 460 } 461 if (((bitField0_ & 0x00000002) != 0)) { 462 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18257045, instance_); 463 } 464 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : 465 internalGetAnnotations().getMap().entrySet()) { 466 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> annotations__ = 467 AnnotationsDefaultEntryHolder.defaultEntry 468 .newBuilderForType() 469 .setKey(entry.getKey()) 470 .setValue(entry.getValue()) 471 .build(); 472 size += com.google.protobuf.CodedOutputStream.computeMessageSize(112032548, annotations__); 473 } 474 if (((bitField0_ & 0x00000004) != 0)) { 475 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(406272220, ipAddress_); 476 } 477 size += getUnknownFields().getSerializedSize(); 478 memoizedSize = size; 479 return size; 480 } 481 482 @java.lang.Override equals(final java.lang.Object obj)483 public boolean equals(final java.lang.Object obj) { 484 if (obj == this) { 485 return true; 486 } 487 if (!(obj instanceof com.google.cloud.compute.v1.NetworkEndpoint)) { 488 return super.equals(obj); 489 } 490 com.google.cloud.compute.v1.NetworkEndpoint other = 491 (com.google.cloud.compute.v1.NetworkEndpoint) obj; 492 493 if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; 494 if (hasFqdn() != other.hasFqdn()) return false; 495 if (hasFqdn()) { 496 if (!getFqdn().equals(other.getFqdn())) return false; 497 } 498 if (hasInstance() != other.hasInstance()) return false; 499 if (hasInstance()) { 500 if (!getInstance().equals(other.getInstance())) return false; 501 } 502 if (hasIpAddress() != other.hasIpAddress()) return false; 503 if (hasIpAddress()) { 504 if (!getIpAddress().equals(other.getIpAddress())) return false; 505 } 506 if (hasPort() != other.hasPort()) return false; 507 if (hasPort()) { 508 if (getPort() != other.getPort()) return false; 509 } 510 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 511 return true; 512 } 513 514 @java.lang.Override hashCode()515 public int hashCode() { 516 if (memoizedHashCode != 0) { 517 return memoizedHashCode; 518 } 519 int hash = 41; 520 hash = (19 * hash) + getDescriptor().hashCode(); 521 if (!internalGetAnnotations().getMap().isEmpty()) { 522 hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; 523 hash = (53 * hash) + internalGetAnnotations().hashCode(); 524 } 525 if (hasFqdn()) { 526 hash = (37 * hash) + FQDN_FIELD_NUMBER; 527 hash = (53 * hash) + getFqdn().hashCode(); 528 } 529 if (hasInstance()) { 530 hash = (37 * hash) + INSTANCE_FIELD_NUMBER; 531 hash = (53 * hash) + getInstance().hashCode(); 532 } 533 if (hasIpAddress()) { 534 hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; 535 hash = (53 * hash) + getIpAddress().hashCode(); 536 } 537 if (hasPort()) { 538 hash = (37 * hash) + PORT_FIELD_NUMBER; 539 hash = (53 * hash) + getPort(); 540 } 541 hash = (29 * hash) + getUnknownFields().hashCode(); 542 memoizedHashCode = hash; 543 return hash; 544 } 545 parseFrom(java.nio.ByteBuffer data)546 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom(java.nio.ByteBuffer data) 547 throws com.google.protobuf.InvalidProtocolBufferException { 548 return PARSER.parseFrom(data); 549 } 550 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)551 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom( 552 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 553 throws com.google.protobuf.InvalidProtocolBufferException { 554 return PARSER.parseFrom(data, extensionRegistry); 555 } 556 parseFrom( com.google.protobuf.ByteString data)557 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom( 558 com.google.protobuf.ByteString data) 559 throws com.google.protobuf.InvalidProtocolBufferException { 560 return PARSER.parseFrom(data); 561 } 562 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)563 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom( 564 com.google.protobuf.ByteString data, 565 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 566 throws com.google.protobuf.InvalidProtocolBufferException { 567 return PARSER.parseFrom(data, extensionRegistry); 568 } 569 parseFrom(byte[] data)570 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom(byte[] data) 571 throws com.google.protobuf.InvalidProtocolBufferException { 572 return PARSER.parseFrom(data); 573 } 574 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)575 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom( 576 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 577 throws com.google.protobuf.InvalidProtocolBufferException { 578 return PARSER.parseFrom(data, extensionRegistry); 579 } 580 parseFrom(java.io.InputStream input)581 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom(java.io.InputStream input) 582 throws java.io.IOException { 583 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 584 } 585 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)586 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom( 587 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 588 throws java.io.IOException { 589 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 590 PARSER, input, extensionRegistry); 591 } 592 parseDelimitedFrom( java.io.InputStream input)593 public static com.google.cloud.compute.v1.NetworkEndpoint parseDelimitedFrom( 594 java.io.InputStream input) throws java.io.IOException { 595 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 596 } 597 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)598 public static com.google.cloud.compute.v1.NetworkEndpoint parseDelimitedFrom( 599 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 600 throws java.io.IOException { 601 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 602 PARSER, input, extensionRegistry); 603 } 604 parseFrom( com.google.protobuf.CodedInputStream input)605 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom( 606 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 607 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 608 } 609 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)610 public static com.google.cloud.compute.v1.NetworkEndpoint parseFrom( 611 com.google.protobuf.CodedInputStream input, 612 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 613 throws java.io.IOException { 614 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 615 PARSER, input, extensionRegistry); 616 } 617 618 @java.lang.Override newBuilderForType()619 public Builder newBuilderForType() { 620 return newBuilder(); 621 } 622 newBuilder()623 public static Builder newBuilder() { 624 return DEFAULT_INSTANCE.toBuilder(); 625 } 626 newBuilder(com.google.cloud.compute.v1.NetworkEndpoint prototype)627 public static Builder newBuilder(com.google.cloud.compute.v1.NetworkEndpoint prototype) { 628 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 629 } 630 631 @java.lang.Override toBuilder()632 public Builder toBuilder() { 633 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 634 } 635 636 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)637 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 638 Builder builder = new Builder(parent); 639 return builder; 640 } 641 /** 642 * 643 * 644 * <pre> 645 * The network endpoint. 646 * </pre> 647 * 648 * Protobuf type {@code google.cloud.compute.v1.NetworkEndpoint} 649 */ 650 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 651 implements 652 // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.NetworkEndpoint) 653 com.google.cloud.compute.v1.NetworkEndpointOrBuilder { getDescriptor()654 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 655 return com.google.cloud.compute.v1.Compute 656 .internal_static_google_cloud_compute_v1_NetworkEndpoint_descriptor; 657 } 658 659 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)660 protected com.google.protobuf.MapField internalGetMapField(int number) { 661 switch (number) { 662 case 112032548: 663 return internalGetAnnotations(); 664 default: 665 throw new RuntimeException("Invalid map field number: " + number); 666 } 667 } 668 669 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)670 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 671 switch (number) { 672 case 112032548: 673 return internalGetMutableAnnotations(); 674 default: 675 throw new RuntimeException("Invalid map field number: " + number); 676 } 677 } 678 679 @java.lang.Override 680 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()681 internalGetFieldAccessorTable() { 682 return com.google.cloud.compute.v1.Compute 683 .internal_static_google_cloud_compute_v1_NetworkEndpoint_fieldAccessorTable 684 .ensureFieldAccessorsInitialized( 685 com.google.cloud.compute.v1.NetworkEndpoint.class, 686 com.google.cloud.compute.v1.NetworkEndpoint.Builder.class); 687 } 688 689 // Construct using com.google.cloud.compute.v1.NetworkEndpoint.newBuilder() Builder()690 private Builder() {} 691 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)692 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 693 super(parent); 694 } 695 696 @java.lang.Override clear()697 public Builder clear() { 698 super.clear(); 699 bitField0_ = 0; 700 internalGetMutableAnnotations().clear(); 701 fqdn_ = ""; 702 instance_ = ""; 703 ipAddress_ = ""; 704 port_ = 0; 705 return this; 706 } 707 708 @java.lang.Override getDescriptorForType()709 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 710 return com.google.cloud.compute.v1.Compute 711 .internal_static_google_cloud_compute_v1_NetworkEndpoint_descriptor; 712 } 713 714 @java.lang.Override getDefaultInstanceForType()715 public com.google.cloud.compute.v1.NetworkEndpoint getDefaultInstanceForType() { 716 return com.google.cloud.compute.v1.NetworkEndpoint.getDefaultInstance(); 717 } 718 719 @java.lang.Override build()720 public com.google.cloud.compute.v1.NetworkEndpoint build() { 721 com.google.cloud.compute.v1.NetworkEndpoint result = buildPartial(); 722 if (!result.isInitialized()) { 723 throw newUninitializedMessageException(result); 724 } 725 return result; 726 } 727 728 @java.lang.Override buildPartial()729 public com.google.cloud.compute.v1.NetworkEndpoint buildPartial() { 730 com.google.cloud.compute.v1.NetworkEndpoint result = 731 new com.google.cloud.compute.v1.NetworkEndpoint(this); 732 if (bitField0_ != 0) { 733 buildPartial0(result); 734 } 735 onBuilt(); 736 return result; 737 } 738 buildPartial0(com.google.cloud.compute.v1.NetworkEndpoint result)739 private void buildPartial0(com.google.cloud.compute.v1.NetworkEndpoint result) { 740 int from_bitField0_ = bitField0_; 741 if (((from_bitField0_ & 0x00000001) != 0)) { 742 result.annotations_ = internalGetAnnotations(); 743 result.annotations_.makeImmutable(); 744 } 745 int to_bitField0_ = 0; 746 if (((from_bitField0_ & 0x00000002) != 0)) { 747 result.fqdn_ = fqdn_; 748 to_bitField0_ |= 0x00000001; 749 } 750 if (((from_bitField0_ & 0x00000004) != 0)) { 751 result.instance_ = instance_; 752 to_bitField0_ |= 0x00000002; 753 } 754 if (((from_bitField0_ & 0x00000008) != 0)) { 755 result.ipAddress_ = ipAddress_; 756 to_bitField0_ |= 0x00000004; 757 } 758 if (((from_bitField0_ & 0x00000010) != 0)) { 759 result.port_ = port_; 760 to_bitField0_ |= 0x00000008; 761 } 762 result.bitField0_ |= to_bitField0_; 763 } 764 765 @java.lang.Override clone()766 public Builder clone() { 767 return super.clone(); 768 } 769 770 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)771 public Builder setField( 772 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 773 return super.setField(field, value); 774 } 775 776 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)777 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 778 return super.clearField(field); 779 } 780 781 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)782 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 783 return super.clearOneof(oneof); 784 } 785 786 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)787 public Builder setRepeatedField( 788 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 789 return super.setRepeatedField(field, index, value); 790 } 791 792 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)793 public Builder addRepeatedField( 794 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 795 return super.addRepeatedField(field, value); 796 } 797 798 @java.lang.Override mergeFrom(com.google.protobuf.Message other)799 public Builder mergeFrom(com.google.protobuf.Message other) { 800 if (other instanceof com.google.cloud.compute.v1.NetworkEndpoint) { 801 return mergeFrom((com.google.cloud.compute.v1.NetworkEndpoint) other); 802 } else { 803 super.mergeFrom(other); 804 return this; 805 } 806 } 807 mergeFrom(com.google.cloud.compute.v1.NetworkEndpoint other)808 public Builder mergeFrom(com.google.cloud.compute.v1.NetworkEndpoint other) { 809 if (other == com.google.cloud.compute.v1.NetworkEndpoint.getDefaultInstance()) return this; 810 internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); 811 bitField0_ |= 0x00000001; 812 if (other.hasFqdn()) { 813 fqdn_ = other.fqdn_; 814 bitField0_ |= 0x00000002; 815 onChanged(); 816 } 817 if (other.hasInstance()) { 818 instance_ = other.instance_; 819 bitField0_ |= 0x00000004; 820 onChanged(); 821 } 822 if (other.hasIpAddress()) { 823 ipAddress_ = other.ipAddress_; 824 bitField0_ |= 0x00000008; 825 onChanged(); 826 } 827 if (other.hasPort()) { 828 setPort(other.getPort()); 829 } 830 this.mergeUnknownFields(other.getUnknownFields()); 831 onChanged(); 832 return this; 833 } 834 835 @java.lang.Override isInitialized()836 public final boolean isInitialized() { 837 return true; 838 } 839 840 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)841 public Builder mergeFrom( 842 com.google.protobuf.CodedInputStream input, 843 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 844 throws java.io.IOException { 845 if (extensionRegistry == null) { 846 throw new java.lang.NullPointerException(); 847 } 848 try { 849 boolean done = false; 850 while (!done) { 851 int tag = input.readTag(); 852 switch (tag) { 853 case 0: 854 done = true; 855 break; 856 case 25203882: 857 { 858 fqdn_ = input.readStringRequireUtf8(); 859 bitField0_ |= 0x00000002; 860 break; 861 } // case 25203882 862 case 27575304: 863 { 864 port_ = input.readInt32(); 865 bitField0_ |= 0x00000010; 866 break; 867 } // case 27575304 868 case 146056362: 869 { 870 instance_ = input.readStringRequireUtf8(); 871 bitField0_ |= 0x00000004; 872 break; 873 } // case 146056362 874 case 896260386: 875 { 876 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> annotations__ = 877 input.readMessage( 878 AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), 879 extensionRegistry); 880 internalGetMutableAnnotations() 881 .getMutableMap() 882 .put(annotations__.getKey(), annotations__.getValue()); 883 bitField0_ |= 0x00000001; 884 break; 885 } // case 896260386 886 case -1044789534: 887 { 888 ipAddress_ = input.readStringRequireUtf8(); 889 bitField0_ |= 0x00000008; 890 break; 891 } // case -1044789534 892 default: 893 { 894 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 895 done = true; // was an endgroup tag 896 } 897 break; 898 } // default: 899 } // switch (tag) 900 } // while (!done) 901 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 902 throw e.unwrapIOException(); 903 } finally { 904 onChanged(); 905 } // finally 906 return this; 907 } 908 909 private int bitField0_; 910 911 private com.google.protobuf.MapField<java.lang.String, java.lang.String> annotations_; 912 913 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetAnnotations()914 internalGetAnnotations() { 915 if (annotations_ == null) { 916 return com.google.protobuf.MapField.emptyMapField( 917 AnnotationsDefaultEntryHolder.defaultEntry); 918 } 919 return annotations_; 920 } 921 922 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableAnnotations()923 internalGetMutableAnnotations() { 924 if (annotations_ == null) { 925 annotations_ = 926 com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); 927 } 928 if (!annotations_.isMutable()) { 929 annotations_ = annotations_.copy(); 930 } 931 bitField0_ |= 0x00000001; 932 onChanged(); 933 return annotations_; 934 } 935 getAnnotationsCount()936 public int getAnnotationsCount() { 937 return internalGetAnnotations().getMap().size(); 938 } 939 /** 940 * 941 * 942 * <pre> 943 * Metadata defined as annotations on the network endpoint. 944 * </pre> 945 * 946 * <code>map<string, string> annotations = 112032548;</code> 947 */ 948 @java.lang.Override containsAnnotations(java.lang.String key)949 public boolean containsAnnotations(java.lang.String key) { 950 if (key == null) { 951 throw new NullPointerException("map key"); 952 } 953 return internalGetAnnotations().getMap().containsKey(key); 954 } 955 /** Use {@link #getAnnotationsMap()} instead. */ 956 @java.lang.Override 957 @java.lang.Deprecated getAnnotations()958 public java.util.Map<java.lang.String, java.lang.String> getAnnotations() { 959 return getAnnotationsMap(); 960 } 961 /** 962 * 963 * 964 * <pre> 965 * Metadata defined as annotations on the network endpoint. 966 * </pre> 967 * 968 * <code>map<string, string> annotations = 112032548;</code> 969 */ 970 @java.lang.Override getAnnotationsMap()971 public java.util.Map<java.lang.String, java.lang.String> getAnnotationsMap() { 972 return internalGetAnnotations().getMap(); 973 } 974 /** 975 * 976 * 977 * <pre> 978 * Metadata defined as annotations on the network endpoint. 979 * </pre> 980 * 981 * <code>map<string, string> annotations = 112032548;</code> 982 */ 983 @java.lang.Override getAnnotationsOrDefault( java.lang.String key, java.lang.String defaultValue)984 public /* nullable */ java.lang.String getAnnotationsOrDefault( 985 java.lang.String key, 986 /* nullable */ 987 java.lang.String defaultValue) { 988 if (key == null) { 989 throw new NullPointerException("map key"); 990 } 991 java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap(); 992 return map.containsKey(key) ? map.get(key) : defaultValue; 993 } 994 /** 995 * 996 * 997 * <pre> 998 * Metadata defined as annotations on the network endpoint. 999 * </pre> 1000 * 1001 * <code>map<string, string> annotations = 112032548;</code> 1002 */ 1003 @java.lang.Override getAnnotationsOrThrow(java.lang.String key)1004 public java.lang.String getAnnotationsOrThrow(java.lang.String key) { 1005 if (key == null) { 1006 throw new NullPointerException("map key"); 1007 } 1008 java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap(); 1009 if (!map.containsKey(key)) { 1010 throw new java.lang.IllegalArgumentException(); 1011 } 1012 return map.get(key); 1013 } 1014 clearAnnotations()1015 public Builder clearAnnotations() { 1016 bitField0_ = (bitField0_ & ~0x00000001); 1017 internalGetMutableAnnotations().getMutableMap().clear(); 1018 return this; 1019 } 1020 /** 1021 * 1022 * 1023 * <pre> 1024 * Metadata defined as annotations on the network endpoint. 1025 * </pre> 1026 * 1027 * <code>map<string, string> annotations = 112032548;</code> 1028 */ removeAnnotations(java.lang.String key)1029 public Builder removeAnnotations(java.lang.String key) { 1030 if (key == null) { 1031 throw new NullPointerException("map key"); 1032 } 1033 internalGetMutableAnnotations().getMutableMap().remove(key); 1034 return this; 1035 } 1036 /** Use alternate mutation accessors instead. */ 1037 @java.lang.Deprecated getMutableAnnotations()1038 public java.util.Map<java.lang.String, java.lang.String> getMutableAnnotations() { 1039 bitField0_ |= 0x00000001; 1040 return internalGetMutableAnnotations().getMutableMap(); 1041 } 1042 /** 1043 * 1044 * 1045 * <pre> 1046 * Metadata defined as annotations on the network endpoint. 1047 * </pre> 1048 * 1049 * <code>map<string, string> annotations = 112032548;</code> 1050 */ putAnnotations(java.lang.String key, java.lang.String value)1051 public Builder putAnnotations(java.lang.String key, java.lang.String value) { 1052 if (key == null) { 1053 throw new NullPointerException("map key"); 1054 } 1055 if (value == null) { 1056 throw new NullPointerException("map value"); 1057 } 1058 internalGetMutableAnnotations().getMutableMap().put(key, value); 1059 bitField0_ |= 0x00000001; 1060 return this; 1061 } 1062 /** 1063 * 1064 * 1065 * <pre> 1066 * Metadata defined as annotations on the network endpoint. 1067 * </pre> 1068 * 1069 * <code>map<string, string> annotations = 112032548;</code> 1070 */ putAllAnnotations(java.util.Map<java.lang.String, java.lang.String> values)1071 public Builder putAllAnnotations(java.util.Map<java.lang.String, java.lang.String> values) { 1072 internalGetMutableAnnotations().getMutableMap().putAll(values); 1073 bitField0_ |= 0x00000001; 1074 return this; 1075 } 1076 1077 private java.lang.Object fqdn_ = ""; 1078 /** 1079 * 1080 * 1081 * <pre> 1082 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 1083 * </pre> 1084 * 1085 * <code>optional string fqdn = 3150485;</code> 1086 * 1087 * @return Whether the fqdn field is set. 1088 */ hasFqdn()1089 public boolean hasFqdn() { 1090 return ((bitField0_ & 0x00000002) != 0); 1091 } 1092 /** 1093 * 1094 * 1095 * <pre> 1096 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 1097 * </pre> 1098 * 1099 * <code>optional string fqdn = 3150485;</code> 1100 * 1101 * @return The fqdn. 1102 */ getFqdn()1103 public java.lang.String getFqdn() { 1104 java.lang.Object ref = fqdn_; 1105 if (!(ref instanceof java.lang.String)) { 1106 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1107 java.lang.String s = bs.toStringUtf8(); 1108 fqdn_ = s; 1109 return s; 1110 } else { 1111 return (java.lang.String) ref; 1112 } 1113 } 1114 /** 1115 * 1116 * 1117 * <pre> 1118 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 1119 * </pre> 1120 * 1121 * <code>optional string fqdn = 3150485;</code> 1122 * 1123 * @return The bytes for fqdn. 1124 */ getFqdnBytes()1125 public com.google.protobuf.ByteString getFqdnBytes() { 1126 java.lang.Object ref = fqdn_; 1127 if (ref instanceof String) { 1128 com.google.protobuf.ByteString b = 1129 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1130 fqdn_ = b; 1131 return b; 1132 } else { 1133 return (com.google.protobuf.ByteString) ref; 1134 } 1135 } 1136 /** 1137 * 1138 * 1139 * <pre> 1140 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 1141 * </pre> 1142 * 1143 * <code>optional string fqdn = 3150485;</code> 1144 * 1145 * @param value The fqdn to set. 1146 * @return This builder for chaining. 1147 */ setFqdn(java.lang.String value)1148 public Builder setFqdn(java.lang.String value) { 1149 if (value == null) { 1150 throw new NullPointerException(); 1151 } 1152 fqdn_ = value; 1153 bitField0_ |= 0x00000002; 1154 onChanged(); 1155 return this; 1156 } 1157 /** 1158 * 1159 * 1160 * <pre> 1161 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 1162 * </pre> 1163 * 1164 * <code>optional string fqdn = 3150485;</code> 1165 * 1166 * @return This builder for chaining. 1167 */ clearFqdn()1168 public Builder clearFqdn() { 1169 fqdn_ = getDefaultInstance().getFqdn(); 1170 bitField0_ = (bitField0_ & ~0x00000002); 1171 onChanged(); 1172 return this; 1173 } 1174 /** 1175 * 1176 * 1177 * <pre> 1178 * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. 1179 * </pre> 1180 * 1181 * <code>optional string fqdn = 3150485;</code> 1182 * 1183 * @param value The bytes for fqdn to set. 1184 * @return This builder for chaining. 1185 */ setFqdnBytes(com.google.protobuf.ByteString value)1186 public Builder setFqdnBytes(com.google.protobuf.ByteString value) { 1187 if (value == null) { 1188 throw new NullPointerException(); 1189 } 1190 checkByteStringIsUtf8(value); 1191 fqdn_ = value; 1192 bitField0_ |= 0x00000002; 1193 onChanged(); 1194 return this; 1195 } 1196 1197 private java.lang.Object instance_ = ""; 1198 /** 1199 * 1200 * 1201 * <pre> 1202 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 1203 * </pre> 1204 * 1205 * <code>optional string instance = 18257045;</code> 1206 * 1207 * @return Whether the instance field is set. 1208 */ hasInstance()1209 public boolean hasInstance() { 1210 return ((bitField0_ & 0x00000004) != 0); 1211 } 1212 /** 1213 * 1214 * 1215 * <pre> 1216 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 1217 * </pre> 1218 * 1219 * <code>optional string instance = 18257045;</code> 1220 * 1221 * @return The instance. 1222 */ getInstance()1223 public java.lang.String getInstance() { 1224 java.lang.Object ref = instance_; 1225 if (!(ref instanceof java.lang.String)) { 1226 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1227 java.lang.String s = bs.toStringUtf8(); 1228 instance_ = s; 1229 return s; 1230 } else { 1231 return (java.lang.String) ref; 1232 } 1233 } 1234 /** 1235 * 1236 * 1237 * <pre> 1238 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 1239 * </pre> 1240 * 1241 * <code>optional string instance = 18257045;</code> 1242 * 1243 * @return The bytes for instance. 1244 */ getInstanceBytes()1245 public com.google.protobuf.ByteString getInstanceBytes() { 1246 java.lang.Object ref = instance_; 1247 if (ref instanceof String) { 1248 com.google.protobuf.ByteString b = 1249 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1250 instance_ = b; 1251 return b; 1252 } else { 1253 return (com.google.protobuf.ByteString) ref; 1254 } 1255 } 1256 /** 1257 * 1258 * 1259 * <pre> 1260 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 1261 * </pre> 1262 * 1263 * <code>optional string instance = 18257045;</code> 1264 * 1265 * @param value The instance to set. 1266 * @return This builder for chaining. 1267 */ setInstance(java.lang.String value)1268 public Builder setInstance(java.lang.String value) { 1269 if (value == null) { 1270 throw new NullPointerException(); 1271 } 1272 instance_ = value; 1273 bitField0_ |= 0x00000004; 1274 onChanged(); 1275 return this; 1276 } 1277 /** 1278 * 1279 * 1280 * <pre> 1281 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 1282 * </pre> 1283 * 1284 * <code>optional string instance = 18257045;</code> 1285 * 1286 * @return This builder for chaining. 1287 */ clearInstance()1288 public Builder clearInstance() { 1289 instance_ = getDefaultInstance().getInstance(); 1290 bitField0_ = (bitField0_ & ~0x00000004); 1291 onChanged(); 1292 return this; 1293 } 1294 /** 1295 * 1296 * 1297 * <pre> 1298 * The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. The name must be 1-63 characters long, and comply with RFC1035. 1299 * </pre> 1300 * 1301 * <code>optional string instance = 18257045;</code> 1302 * 1303 * @param value The bytes for instance to set. 1304 * @return This builder for chaining. 1305 */ setInstanceBytes(com.google.protobuf.ByteString value)1306 public Builder setInstanceBytes(com.google.protobuf.ByteString value) { 1307 if (value == null) { 1308 throw new NullPointerException(); 1309 } 1310 checkByteStringIsUtf8(value); 1311 instance_ = value; 1312 bitField0_ |= 0x00000004; 1313 onChanged(); 1314 return this; 1315 } 1316 1317 private java.lang.Object ipAddress_ = ""; 1318 /** 1319 * 1320 * 1321 * <pre> 1322 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 1323 * </pre> 1324 * 1325 * <code>optional string ip_address = 406272220;</code> 1326 * 1327 * @return Whether the ipAddress field is set. 1328 */ hasIpAddress()1329 public boolean hasIpAddress() { 1330 return ((bitField0_ & 0x00000008) != 0); 1331 } 1332 /** 1333 * 1334 * 1335 * <pre> 1336 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 1337 * </pre> 1338 * 1339 * <code>optional string ip_address = 406272220;</code> 1340 * 1341 * @return The ipAddress. 1342 */ getIpAddress()1343 public java.lang.String getIpAddress() { 1344 java.lang.Object ref = ipAddress_; 1345 if (!(ref instanceof java.lang.String)) { 1346 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1347 java.lang.String s = bs.toStringUtf8(); 1348 ipAddress_ = s; 1349 return s; 1350 } else { 1351 return (java.lang.String) ref; 1352 } 1353 } 1354 /** 1355 * 1356 * 1357 * <pre> 1358 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 1359 * </pre> 1360 * 1361 * <code>optional string ip_address = 406272220;</code> 1362 * 1363 * @return The bytes for ipAddress. 1364 */ getIpAddressBytes()1365 public com.google.protobuf.ByteString getIpAddressBytes() { 1366 java.lang.Object ref = ipAddress_; 1367 if (ref instanceof String) { 1368 com.google.protobuf.ByteString b = 1369 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1370 ipAddress_ = b; 1371 return b; 1372 } else { 1373 return (com.google.protobuf.ByteString) ref; 1374 } 1375 } 1376 /** 1377 * 1378 * 1379 * <pre> 1380 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 1381 * </pre> 1382 * 1383 * <code>optional string ip_address = 406272220;</code> 1384 * 1385 * @param value The ipAddress to set. 1386 * @return This builder for chaining. 1387 */ setIpAddress(java.lang.String value)1388 public Builder setIpAddress(java.lang.String value) { 1389 if (value == null) { 1390 throw new NullPointerException(); 1391 } 1392 ipAddress_ = value; 1393 bitField0_ |= 0x00000008; 1394 onChanged(); 1395 return this; 1396 } 1397 /** 1398 * 1399 * 1400 * <pre> 1401 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 1402 * </pre> 1403 * 1404 * <code>optional string ip_address = 406272220;</code> 1405 * 1406 * @return This builder for chaining. 1407 */ clearIpAddress()1408 public Builder clearIpAddress() { 1409 ipAddress_ = getDefaultInstance().getIpAddress(); 1410 bitField0_ = (bitField0_ & ~0x00000008); 1411 onChanged(); 1412 return this; 1413 } 1414 /** 1415 * 1416 * 1417 * <pre> 1418 * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. 1419 * </pre> 1420 * 1421 * <code>optional string ip_address = 406272220;</code> 1422 * 1423 * @param value The bytes for ipAddress to set. 1424 * @return This builder for chaining. 1425 */ setIpAddressBytes(com.google.protobuf.ByteString value)1426 public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { 1427 if (value == null) { 1428 throw new NullPointerException(); 1429 } 1430 checkByteStringIsUtf8(value); 1431 ipAddress_ = value; 1432 bitField0_ |= 0x00000008; 1433 onChanged(); 1434 return this; 1435 } 1436 1437 private int port_; 1438 /** 1439 * 1440 * 1441 * <pre> 1442 * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. 1443 * </pre> 1444 * 1445 * <code>optional int32 port = 3446913;</code> 1446 * 1447 * @return Whether the port field is set. 1448 */ 1449 @java.lang.Override hasPort()1450 public boolean hasPort() { 1451 return ((bitField0_ & 0x00000010) != 0); 1452 } 1453 /** 1454 * 1455 * 1456 * <pre> 1457 * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. 1458 * </pre> 1459 * 1460 * <code>optional int32 port = 3446913;</code> 1461 * 1462 * @return The port. 1463 */ 1464 @java.lang.Override getPort()1465 public int getPort() { 1466 return port_; 1467 } 1468 /** 1469 * 1470 * 1471 * <pre> 1472 * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. 1473 * </pre> 1474 * 1475 * <code>optional int32 port = 3446913;</code> 1476 * 1477 * @param value The port to set. 1478 * @return This builder for chaining. 1479 */ setPort(int value)1480 public Builder setPort(int value) { 1481 1482 port_ = value; 1483 bitField0_ |= 0x00000010; 1484 onChanged(); 1485 return this; 1486 } 1487 /** 1488 * 1489 * 1490 * <pre> 1491 * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. 1492 * </pre> 1493 * 1494 * <code>optional int32 port = 3446913;</code> 1495 * 1496 * @return This builder for chaining. 1497 */ clearPort()1498 public Builder clearPort() { 1499 bitField0_ = (bitField0_ & ~0x00000010); 1500 port_ = 0; 1501 onChanged(); 1502 return this; 1503 } 1504 1505 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1506 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1507 return super.setUnknownFields(unknownFields); 1508 } 1509 1510 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1511 public final Builder mergeUnknownFields( 1512 final com.google.protobuf.UnknownFieldSet unknownFields) { 1513 return super.mergeUnknownFields(unknownFields); 1514 } 1515 1516 // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.NetworkEndpoint) 1517 } 1518 1519 // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.NetworkEndpoint) 1520 private static final com.google.cloud.compute.v1.NetworkEndpoint DEFAULT_INSTANCE; 1521 1522 static { 1523 DEFAULT_INSTANCE = new com.google.cloud.compute.v1.NetworkEndpoint(); 1524 } 1525 getDefaultInstance()1526 public static com.google.cloud.compute.v1.NetworkEndpoint getDefaultInstance() { 1527 return DEFAULT_INSTANCE; 1528 } 1529 1530 private static final com.google.protobuf.Parser<NetworkEndpoint> PARSER = 1531 new com.google.protobuf.AbstractParser<NetworkEndpoint>() { 1532 @java.lang.Override 1533 public NetworkEndpoint parsePartialFrom( 1534 com.google.protobuf.CodedInputStream input, 1535 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1536 throws com.google.protobuf.InvalidProtocolBufferException { 1537 Builder builder = newBuilder(); 1538 try { 1539 builder.mergeFrom(input, extensionRegistry); 1540 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1541 throw e.setUnfinishedMessage(builder.buildPartial()); 1542 } catch (com.google.protobuf.UninitializedMessageException e) { 1543 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1544 } catch (java.io.IOException e) { 1545 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1546 .setUnfinishedMessage(builder.buildPartial()); 1547 } 1548 return builder.buildPartial(); 1549 } 1550 }; 1551 parser()1552 public static com.google.protobuf.Parser<NetworkEndpoint> parser() { 1553 return PARSER; 1554 } 1555 1556 @java.lang.Override getParserForType()1557 public com.google.protobuf.Parser<NetworkEndpoint> getParserForType() { 1558 return PARSER; 1559 } 1560 1561 @java.lang.Override getDefaultInstanceForType()1562 public com.google.cloud.compute.v1.NetworkEndpoint getDefaultInstanceForType() { 1563 return DEFAULT_INSTANCE; 1564 } 1565 } 1566