• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  * Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.compute.v1.SchedulingNodeAffinity}
29  */
30 public final class SchedulingNodeAffinity extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.SchedulingNodeAffinity)
33     SchedulingNodeAffinityOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use SchedulingNodeAffinity.newBuilder() to construct.
SchedulingNodeAffinity(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private SchedulingNodeAffinity(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
SchedulingNodeAffinity()40   private SchedulingNodeAffinity() {
41     key_ = "";
42     operator_ = "";
43     values_ = com.google.protobuf.LazyStringArrayList.EMPTY;
44   }
45 
46   @java.lang.Override
47   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)48   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
49     return new SchedulingNodeAffinity();
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_SchedulingNodeAffinity_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_SchedulingNodeAffinity_fieldAccessorTable
67         .ensureFieldAccessorsInitialized(
68             com.google.cloud.compute.v1.SchedulingNodeAffinity.class,
69             com.google.cloud.compute.v1.SchedulingNodeAffinity.Builder.class);
70   }
71 
72   /**
73    *
74    *
75    * <pre>
76    * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
77    * </pre>
78    *
79    * Protobuf enum {@code google.cloud.compute.v1.SchedulingNodeAffinity.Operator}
80    */
81   public enum Operator implements com.google.protobuf.ProtocolMessageEnum {
82     /**
83      *
84      *
85      * <pre>
86      * A value indicating that the enum field is not set.
87      * </pre>
88      *
89      * <code>UNDEFINED_OPERATOR = 0;</code>
90      */
91     UNDEFINED_OPERATOR(0),
92     /**
93      *
94      *
95      * <pre>
96      * Requires Compute Engine to seek for matched nodes.
97      * </pre>
98      *
99      * <code>IN = 2341;</code>
100      */
101     IN(2341),
102     /**
103      *
104      *
105      * <pre>
106      * Requires Compute Engine to avoid certain nodes.
107      * </pre>
108      *
109      * <code>NOT_IN = 161144369;</code>
110      */
111     NOT_IN(161144369),
112     /** <code>OPERATOR_UNSPECIFIED = 128892924;</code> */
113     OPERATOR_UNSPECIFIED(128892924),
114     UNRECOGNIZED(-1),
115     ;
116 
117     /**
118      *
119      *
120      * <pre>
121      * A value indicating that the enum field is not set.
122      * </pre>
123      *
124      * <code>UNDEFINED_OPERATOR = 0;</code>
125      */
126     public static final int UNDEFINED_OPERATOR_VALUE = 0;
127     /**
128      *
129      *
130      * <pre>
131      * Requires Compute Engine to seek for matched nodes.
132      * </pre>
133      *
134      * <code>IN = 2341;</code>
135      */
136     public static final int IN_VALUE = 2341;
137     /**
138      *
139      *
140      * <pre>
141      * Requires Compute Engine to avoid certain nodes.
142      * </pre>
143      *
144      * <code>NOT_IN = 161144369;</code>
145      */
146     public static final int NOT_IN_VALUE = 161144369;
147     /** <code>OPERATOR_UNSPECIFIED = 128892924;</code> */
148     public static final int OPERATOR_UNSPECIFIED_VALUE = 128892924;
149 
getNumber()150     public final int getNumber() {
151       if (this == UNRECOGNIZED) {
152         throw new java.lang.IllegalArgumentException(
153             "Can't get the number of an unknown enum value.");
154       }
155       return value;
156     }
157 
158     /**
159      * @param value The numeric wire value of the corresponding enum entry.
160      * @return The enum associated with the given numeric wire value.
161      * @deprecated Use {@link #forNumber(int)} instead.
162      */
163     @java.lang.Deprecated
valueOf(int value)164     public static Operator valueOf(int value) {
165       return forNumber(value);
166     }
167 
168     /**
169      * @param value The numeric wire value of the corresponding enum entry.
170      * @return The enum associated with the given numeric wire value.
171      */
forNumber(int value)172     public static Operator forNumber(int value) {
173       switch (value) {
174         case 0:
175           return UNDEFINED_OPERATOR;
176         case 2341:
177           return IN;
178         case 161144369:
179           return NOT_IN;
180         case 128892924:
181           return OPERATOR_UNSPECIFIED;
182         default:
183           return null;
184       }
185     }
186 
internalGetValueMap()187     public static com.google.protobuf.Internal.EnumLiteMap<Operator> internalGetValueMap() {
188       return internalValueMap;
189     }
190 
191     private static final com.google.protobuf.Internal.EnumLiteMap<Operator> internalValueMap =
192         new com.google.protobuf.Internal.EnumLiteMap<Operator>() {
193           public Operator findValueByNumber(int number) {
194             return Operator.forNumber(number);
195           }
196         };
197 
getValueDescriptor()198     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
199       if (this == UNRECOGNIZED) {
200         throw new java.lang.IllegalStateException(
201             "Can't get the descriptor of an unrecognized enum value.");
202       }
203       return getDescriptor().getValues().get(ordinal());
204     }
205 
getDescriptorForType()206     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
207       return getDescriptor();
208     }
209 
getDescriptor()210     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
211       return com.google.cloud.compute.v1.SchedulingNodeAffinity.getDescriptor()
212           .getEnumTypes()
213           .get(0);
214     }
215 
216     private static final Operator[] VALUES = values();
217 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)218     public static Operator valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
219       if (desc.getType() != getDescriptor()) {
220         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
221       }
222       if (desc.getIndex() == -1) {
223         return UNRECOGNIZED;
224       }
225       return VALUES[desc.getIndex()];
226     }
227 
228     private final int value;
229 
Operator(int value)230     private Operator(int value) {
231       this.value = value;
232     }
233 
234     // @@protoc_insertion_point(enum_scope:google.cloud.compute.v1.SchedulingNodeAffinity.Operator)
235   }
236 
237   private int bitField0_;
238   public static final int KEY_FIELD_NUMBER = 106079;
239 
240   @SuppressWarnings("serial")
241   private volatile java.lang.Object key_ = "";
242   /**
243    *
244    *
245    * <pre>
246    * Corresponds to the label key of Node resource.
247    * </pre>
248    *
249    * <code>optional string key = 106079;</code>
250    *
251    * @return Whether the key field is set.
252    */
253   @java.lang.Override
hasKey()254   public boolean hasKey() {
255     return ((bitField0_ & 0x00000001) != 0);
256   }
257   /**
258    *
259    *
260    * <pre>
261    * Corresponds to the label key of Node resource.
262    * </pre>
263    *
264    * <code>optional string key = 106079;</code>
265    *
266    * @return The key.
267    */
268   @java.lang.Override
getKey()269   public java.lang.String getKey() {
270     java.lang.Object ref = key_;
271     if (ref instanceof java.lang.String) {
272       return (java.lang.String) ref;
273     } else {
274       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
275       java.lang.String s = bs.toStringUtf8();
276       key_ = s;
277       return s;
278     }
279   }
280   /**
281    *
282    *
283    * <pre>
284    * Corresponds to the label key of Node resource.
285    * </pre>
286    *
287    * <code>optional string key = 106079;</code>
288    *
289    * @return The bytes for key.
290    */
291   @java.lang.Override
getKeyBytes()292   public com.google.protobuf.ByteString getKeyBytes() {
293     java.lang.Object ref = key_;
294     if (ref instanceof java.lang.String) {
295       com.google.protobuf.ByteString b =
296           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
297       key_ = b;
298       return b;
299     } else {
300       return (com.google.protobuf.ByteString) ref;
301     }
302   }
303 
304   public static final int OPERATOR_FIELD_NUMBER = 36317348;
305 
306   @SuppressWarnings("serial")
307   private volatile java.lang.Object operator_ = "";
308   /**
309    *
310    *
311    * <pre>
312    * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
313    * Check the Operator enum for the list of possible values.
314    * </pre>
315    *
316    * <code>optional string operator = 36317348;</code>
317    *
318    * @return Whether the operator field is set.
319    */
320   @java.lang.Override
hasOperator()321   public boolean hasOperator() {
322     return ((bitField0_ & 0x00000002) != 0);
323   }
324   /**
325    *
326    *
327    * <pre>
328    * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
329    * Check the Operator enum for the list of possible values.
330    * </pre>
331    *
332    * <code>optional string operator = 36317348;</code>
333    *
334    * @return The operator.
335    */
336   @java.lang.Override
getOperator()337   public java.lang.String getOperator() {
338     java.lang.Object ref = operator_;
339     if (ref instanceof java.lang.String) {
340       return (java.lang.String) ref;
341     } else {
342       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
343       java.lang.String s = bs.toStringUtf8();
344       operator_ = s;
345       return s;
346     }
347   }
348   /**
349    *
350    *
351    * <pre>
352    * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
353    * Check the Operator enum for the list of possible values.
354    * </pre>
355    *
356    * <code>optional string operator = 36317348;</code>
357    *
358    * @return The bytes for operator.
359    */
360   @java.lang.Override
getOperatorBytes()361   public com.google.protobuf.ByteString getOperatorBytes() {
362     java.lang.Object ref = operator_;
363     if (ref instanceof java.lang.String) {
364       com.google.protobuf.ByteString b =
365           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
366       operator_ = b;
367       return b;
368     } else {
369       return (com.google.protobuf.ByteString) ref;
370     }
371   }
372 
373   public static final int VALUES_FIELD_NUMBER = 249928994;
374 
375   @SuppressWarnings("serial")
376   private com.google.protobuf.LazyStringList values_;
377   /**
378    *
379    *
380    * <pre>
381    * Corresponds to the label values of Node resource.
382    * </pre>
383    *
384    * <code>repeated string values = 249928994;</code>
385    *
386    * @return A list containing the values.
387    */
getValuesList()388   public com.google.protobuf.ProtocolStringList getValuesList() {
389     return values_;
390   }
391   /**
392    *
393    *
394    * <pre>
395    * Corresponds to the label values of Node resource.
396    * </pre>
397    *
398    * <code>repeated string values = 249928994;</code>
399    *
400    * @return The count of values.
401    */
getValuesCount()402   public int getValuesCount() {
403     return values_.size();
404   }
405   /**
406    *
407    *
408    * <pre>
409    * Corresponds to the label values of Node resource.
410    * </pre>
411    *
412    * <code>repeated string values = 249928994;</code>
413    *
414    * @param index The index of the element to return.
415    * @return The values at the given index.
416    */
getValues(int index)417   public java.lang.String getValues(int index) {
418     return values_.get(index);
419   }
420   /**
421    *
422    *
423    * <pre>
424    * Corresponds to the label values of Node resource.
425    * </pre>
426    *
427    * <code>repeated string values = 249928994;</code>
428    *
429    * @param index The index of the value to return.
430    * @return The bytes of the values at the given index.
431    */
getValuesBytes(int index)432   public com.google.protobuf.ByteString getValuesBytes(int index) {
433     return values_.getByteString(index);
434   }
435 
436   private byte memoizedIsInitialized = -1;
437 
438   @java.lang.Override
isInitialized()439   public final boolean isInitialized() {
440     byte isInitialized = memoizedIsInitialized;
441     if (isInitialized == 1) return true;
442     if (isInitialized == 0) return false;
443 
444     memoizedIsInitialized = 1;
445     return true;
446   }
447 
448   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)449   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
450     if (((bitField0_ & 0x00000001) != 0)) {
451       com.google.protobuf.GeneratedMessageV3.writeString(output, 106079, key_);
452     }
453     if (((bitField0_ & 0x00000002) != 0)) {
454       com.google.protobuf.GeneratedMessageV3.writeString(output, 36317348, operator_);
455     }
456     for (int i = 0; i < values_.size(); i++) {
457       com.google.protobuf.GeneratedMessageV3.writeString(output, 249928994, values_.getRaw(i));
458     }
459     getUnknownFields().writeTo(output);
460   }
461 
462   @java.lang.Override
getSerializedSize()463   public int getSerializedSize() {
464     int size = memoizedSize;
465     if (size != -1) return size;
466 
467     size = 0;
468     if (((bitField0_ & 0x00000001) != 0)) {
469       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(106079, key_);
470     }
471     if (((bitField0_ & 0x00000002) != 0)) {
472       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(36317348, operator_);
473     }
474     {
475       int dataSize = 0;
476       for (int i = 0; i < values_.size(); i++) {
477         dataSize += computeStringSizeNoTag(values_.getRaw(i));
478       }
479       size += dataSize;
480       size += 5 * getValuesList().size();
481     }
482     size += getUnknownFields().getSerializedSize();
483     memoizedSize = size;
484     return size;
485   }
486 
487   @java.lang.Override
equals(final java.lang.Object obj)488   public boolean equals(final java.lang.Object obj) {
489     if (obj == this) {
490       return true;
491     }
492     if (!(obj instanceof com.google.cloud.compute.v1.SchedulingNodeAffinity)) {
493       return super.equals(obj);
494     }
495     com.google.cloud.compute.v1.SchedulingNodeAffinity other =
496         (com.google.cloud.compute.v1.SchedulingNodeAffinity) obj;
497 
498     if (hasKey() != other.hasKey()) return false;
499     if (hasKey()) {
500       if (!getKey().equals(other.getKey())) return false;
501     }
502     if (hasOperator() != other.hasOperator()) return false;
503     if (hasOperator()) {
504       if (!getOperator().equals(other.getOperator())) return false;
505     }
506     if (!getValuesList().equals(other.getValuesList())) return false;
507     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
508     return true;
509   }
510 
511   @java.lang.Override
hashCode()512   public int hashCode() {
513     if (memoizedHashCode != 0) {
514       return memoizedHashCode;
515     }
516     int hash = 41;
517     hash = (19 * hash) + getDescriptor().hashCode();
518     if (hasKey()) {
519       hash = (37 * hash) + KEY_FIELD_NUMBER;
520       hash = (53 * hash) + getKey().hashCode();
521     }
522     if (hasOperator()) {
523       hash = (37 * hash) + OPERATOR_FIELD_NUMBER;
524       hash = (53 * hash) + getOperator().hashCode();
525     }
526     if (getValuesCount() > 0) {
527       hash = (37 * hash) + VALUES_FIELD_NUMBER;
528       hash = (53 * hash) + getValuesList().hashCode();
529     }
530     hash = (29 * hash) + getUnknownFields().hashCode();
531     memoizedHashCode = hash;
532     return hash;
533   }
534 
parseFrom( java.nio.ByteBuffer data)535   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
536       java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
537     return PARSER.parseFrom(data);
538   }
539 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)540   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
541       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
542       throws com.google.protobuf.InvalidProtocolBufferException {
543     return PARSER.parseFrom(data, extensionRegistry);
544   }
545 
parseFrom( com.google.protobuf.ByteString data)546   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
547       com.google.protobuf.ByteString data)
548       throws com.google.protobuf.InvalidProtocolBufferException {
549     return PARSER.parseFrom(data);
550   }
551 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)552   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
553       com.google.protobuf.ByteString data,
554       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
555       throws com.google.protobuf.InvalidProtocolBufferException {
556     return PARSER.parseFrom(data, extensionRegistry);
557   }
558 
parseFrom(byte[] data)559   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(byte[] data)
560       throws com.google.protobuf.InvalidProtocolBufferException {
561     return PARSER.parseFrom(data);
562   }
563 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)564   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
565       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
566       throws com.google.protobuf.InvalidProtocolBufferException {
567     return PARSER.parseFrom(data, extensionRegistry);
568   }
569 
parseFrom( java.io.InputStream input)570   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
571       java.io.InputStream input) throws java.io.IOException {
572     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
573   }
574 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)575   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
576       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
577       throws java.io.IOException {
578     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
579         PARSER, input, extensionRegistry);
580   }
581 
parseDelimitedFrom( java.io.InputStream input)582   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseDelimitedFrom(
583       java.io.InputStream input) throws java.io.IOException {
584     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
585   }
586 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)587   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseDelimitedFrom(
588       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
589       throws java.io.IOException {
590     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
591         PARSER, input, extensionRegistry);
592   }
593 
parseFrom( com.google.protobuf.CodedInputStream input)594   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
595       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
596     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
597   }
598 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)599   public static com.google.cloud.compute.v1.SchedulingNodeAffinity parseFrom(
600       com.google.protobuf.CodedInputStream input,
601       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
602       throws java.io.IOException {
603     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
604         PARSER, input, extensionRegistry);
605   }
606 
607   @java.lang.Override
newBuilderForType()608   public Builder newBuilderForType() {
609     return newBuilder();
610   }
611 
newBuilder()612   public static Builder newBuilder() {
613     return DEFAULT_INSTANCE.toBuilder();
614   }
615 
newBuilder(com.google.cloud.compute.v1.SchedulingNodeAffinity prototype)616   public static Builder newBuilder(com.google.cloud.compute.v1.SchedulingNodeAffinity prototype) {
617     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
618   }
619 
620   @java.lang.Override
toBuilder()621   public Builder toBuilder() {
622     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
623   }
624 
625   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)626   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
627     Builder builder = new Builder(parent);
628     return builder;
629   }
630   /**
631    *
632    *
633    * <pre>
634    * Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled.
635    * </pre>
636    *
637    * Protobuf type {@code google.cloud.compute.v1.SchedulingNodeAffinity}
638    */
639   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
640       implements
641       // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.SchedulingNodeAffinity)
642       com.google.cloud.compute.v1.SchedulingNodeAffinityOrBuilder {
getDescriptor()643     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
644       return com.google.cloud.compute.v1.Compute
645           .internal_static_google_cloud_compute_v1_SchedulingNodeAffinity_descriptor;
646     }
647 
648     @java.lang.Override
649     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()650         internalGetFieldAccessorTable() {
651       return com.google.cloud.compute.v1.Compute
652           .internal_static_google_cloud_compute_v1_SchedulingNodeAffinity_fieldAccessorTable
653           .ensureFieldAccessorsInitialized(
654               com.google.cloud.compute.v1.SchedulingNodeAffinity.class,
655               com.google.cloud.compute.v1.SchedulingNodeAffinity.Builder.class);
656     }
657 
658     // Construct using com.google.cloud.compute.v1.SchedulingNodeAffinity.newBuilder()
Builder()659     private Builder() {}
660 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)661     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
662       super(parent);
663     }
664 
665     @java.lang.Override
clear()666     public Builder clear() {
667       super.clear();
668       bitField0_ = 0;
669       key_ = "";
670       operator_ = "";
671       values_ = com.google.protobuf.LazyStringArrayList.EMPTY;
672       bitField0_ = (bitField0_ & ~0x00000004);
673       return this;
674     }
675 
676     @java.lang.Override
getDescriptorForType()677     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
678       return com.google.cloud.compute.v1.Compute
679           .internal_static_google_cloud_compute_v1_SchedulingNodeAffinity_descriptor;
680     }
681 
682     @java.lang.Override
getDefaultInstanceForType()683     public com.google.cloud.compute.v1.SchedulingNodeAffinity getDefaultInstanceForType() {
684       return com.google.cloud.compute.v1.SchedulingNodeAffinity.getDefaultInstance();
685     }
686 
687     @java.lang.Override
build()688     public com.google.cloud.compute.v1.SchedulingNodeAffinity build() {
689       com.google.cloud.compute.v1.SchedulingNodeAffinity result = buildPartial();
690       if (!result.isInitialized()) {
691         throw newUninitializedMessageException(result);
692       }
693       return result;
694     }
695 
696     @java.lang.Override
buildPartial()697     public com.google.cloud.compute.v1.SchedulingNodeAffinity buildPartial() {
698       com.google.cloud.compute.v1.SchedulingNodeAffinity result =
699           new com.google.cloud.compute.v1.SchedulingNodeAffinity(this);
700       buildPartialRepeatedFields(result);
701       if (bitField0_ != 0) {
702         buildPartial0(result);
703       }
704       onBuilt();
705       return result;
706     }
707 
buildPartialRepeatedFields( com.google.cloud.compute.v1.SchedulingNodeAffinity result)708     private void buildPartialRepeatedFields(
709         com.google.cloud.compute.v1.SchedulingNodeAffinity result) {
710       if (((bitField0_ & 0x00000004) != 0)) {
711         values_ = values_.getUnmodifiableView();
712         bitField0_ = (bitField0_ & ~0x00000004);
713       }
714       result.values_ = values_;
715     }
716 
buildPartial0(com.google.cloud.compute.v1.SchedulingNodeAffinity result)717     private void buildPartial0(com.google.cloud.compute.v1.SchedulingNodeAffinity result) {
718       int from_bitField0_ = bitField0_;
719       int to_bitField0_ = 0;
720       if (((from_bitField0_ & 0x00000001) != 0)) {
721         result.key_ = key_;
722         to_bitField0_ |= 0x00000001;
723       }
724       if (((from_bitField0_ & 0x00000002) != 0)) {
725         result.operator_ = operator_;
726         to_bitField0_ |= 0x00000002;
727       }
728       result.bitField0_ |= to_bitField0_;
729     }
730 
731     @java.lang.Override
clone()732     public Builder clone() {
733       return super.clone();
734     }
735 
736     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)737     public Builder setField(
738         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
739       return super.setField(field, value);
740     }
741 
742     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)743     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
744       return super.clearField(field);
745     }
746 
747     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)748     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
749       return super.clearOneof(oneof);
750     }
751 
752     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)753     public Builder setRepeatedField(
754         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
755       return super.setRepeatedField(field, index, value);
756     }
757 
758     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)759     public Builder addRepeatedField(
760         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
761       return super.addRepeatedField(field, value);
762     }
763 
764     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)765     public Builder mergeFrom(com.google.protobuf.Message other) {
766       if (other instanceof com.google.cloud.compute.v1.SchedulingNodeAffinity) {
767         return mergeFrom((com.google.cloud.compute.v1.SchedulingNodeAffinity) other);
768       } else {
769         super.mergeFrom(other);
770         return this;
771       }
772     }
773 
mergeFrom(com.google.cloud.compute.v1.SchedulingNodeAffinity other)774     public Builder mergeFrom(com.google.cloud.compute.v1.SchedulingNodeAffinity other) {
775       if (other == com.google.cloud.compute.v1.SchedulingNodeAffinity.getDefaultInstance())
776         return this;
777       if (other.hasKey()) {
778         key_ = other.key_;
779         bitField0_ |= 0x00000001;
780         onChanged();
781       }
782       if (other.hasOperator()) {
783         operator_ = other.operator_;
784         bitField0_ |= 0x00000002;
785         onChanged();
786       }
787       if (!other.values_.isEmpty()) {
788         if (values_.isEmpty()) {
789           values_ = other.values_;
790           bitField0_ = (bitField0_ & ~0x00000004);
791         } else {
792           ensureValuesIsMutable();
793           values_.addAll(other.values_);
794         }
795         onChanged();
796       }
797       this.mergeUnknownFields(other.getUnknownFields());
798       onChanged();
799       return this;
800     }
801 
802     @java.lang.Override
isInitialized()803     public final boolean isInitialized() {
804       return true;
805     }
806 
807     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)808     public Builder mergeFrom(
809         com.google.protobuf.CodedInputStream input,
810         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
811         throws java.io.IOException {
812       if (extensionRegistry == null) {
813         throw new java.lang.NullPointerException();
814       }
815       try {
816         boolean done = false;
817         while (!done) {
818           int tag = input.readTag();
819           switch (tag) {
820             case 0:
821               done = true;
822               break;
823             case 848634:
824               {
825                 key_ = input.readStringRequireUtf8();
826                 bitField0_ |= 0x00000001;
827                 break;
828               } // case 848634
829             case 290538786:
830               {
831                 operator_ = input.readStringRequireUtf8();
832                 bitField0_ |= 0x00000002;
833                 break;
834               } // case 290538786
835             case 1999431954:
836               {
837                 java.lang.String s = input.readStringRequireUtf8();
838                 ensureValuesIsMutable();
839                 values_.add(s);
840                 break;
841               } // case 1999431954
842             default:
843               {
844                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
845                   done = true; // was an endgroup tag
846                 }
847                 break;
848               } // default:
849           } // switch (tag)
850         } // while (!done)
851       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
852         throw e.unwrapIOException();
853       } finally {
854         onChanged();
855       } // finally
856       return this;
857     }
858 
859     private int bitField0_;
860 
861     private java.lang.Object key_ = "";
862     /**
863      *
864      *
865      * <pre>
866      * Corresponds to the label key of Node resource.
867      * </pre>
868      *
869      * <code>optional string key = 106079;</code>
870      *
871      * @return Whether the key field is set.
872      */
hasKey()873     public boolean hasKey() {
874       return ((bitField0_ & 0x00000001) != 0);
875     }
876     /**
877      *
878      *
879      * <pre>
880      * Corresponds to the label key of Node resource.
881      * </pre>
882      *
883      * <code>optional string key = 106079;</code>
884      *
885      * @return The key.
886      */
getKey()887     public java.lang.String getKey() {
888       java.lang.Object ref = key_;
889       if (!(ref instanceof java.lang.String)) {
890         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
891         java.lang.String s = bs.toStringUtf8();
892         key_ = s;
893         return s;
894       } else {
895         return (java.lang.String) ref;
896       }
897     }
898     /**
899      *
900      *
901      * <pre>
902      * Corresponds to the label key of Node resource.
903      * </pre>
904      *
905      * <code>optional string key = 106079;</code>
906      *
907      * @return The bytes for key.
908      */
getKeyBytes()909     public com.google.protobuf.ByteString getKeyBytes() {
910       java.lang.Object ref = key_;
911       if (ref instanceof String) {
912         com.google.protobuf.ByteString b =
913             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
914         key_ = b;
915         return b;
916       } else {
917         return (com.google.protobuf.ByteString) ref;
918       }
919     }
920     /**
921      *
922      *
923      * <pre>
924      * Corresponds to the label key of Node resource.
925      * </pre>
926      *
927      * <code>optional string key = 106079;</code>
928      *
929      * @param value The key to set.
930      * @return This builder for chaining.
931      */
setKey(java.lang.String value)932     public Builder setKey(java.lang.String value) {
933       if (value == null) {
934         throw new NullPointerException();
935       }
936       key_ = value;
937       bitField0_ |= 0x00000001;
938       onChanged();
939       return this;
940     }
941     /**
942      *
943      *
944      * <pre>
945      * Corresponds to the label key of Node resource.
946      * </pre>
947      *
948      * <code>optional string key = 106079;</code>
949      *
950      * @return This builder for chaining.
951      */
clearKey()952     public Builder clearKey() {
953       key_ = getDefaultInstance().getKey();
954       bitField0_ = (bitField0_ & ~0x00000001);
955       onChanged();
956       return this;
957     }
958     /**
959      *
960      *
961      * <pre>
962      * Corresponds to the label key of Node resource.
963      * </pre>
964      *
965      * <code>optional string key = 106079;</code>
966      *
967      * @param value The bytes for key to set.
968      * @return This builder for chaining.
969      */
setKeyBytes(com.google.protobuf.ByteString value)970     public Builder setKeyBytes(com.google.protobuf.ByteString value) {
971       if (value == null) {
972         throw new NullPointerException();
973       }
974       checkByteStringIsUtf8(value);
975       key_ = value;
976       bitField0_ |= 0x00000001;
977       onChanged();
978       return this;
979     }
980 
981     private java.lang.Object operator_ = "";
982     /**
983      *
984      *
985      * <pre>
986      * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
987      * Check the Operator enum for the list of possible values.
988      * </pre>
989      *
990      * <code>optional string operator = 36317348;</code>
991      *
992      * @return Whether the operator field is set.
993      */
hasOperator()994     public boolean hasOperator() {
995       return ((bitField0_ & 0x00000002) != 0);
996     }
997     /**
998      *
999      *
1000      * <pre>
1001      * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
1002      * Check the Operator enum for the list of possible values.
1003      * </pre>
1004      *
1005      * <code>optional string operator = 36317348;</code>
1006      *
1007      * @return The operator.
1008      */
getOperator()1009     public java.lang.String getOperator() {
1010       java.lang.Object ref = operator_;
1011       if (!(ref instanceof java.lang.String)) {
1012         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1013         java.lang.String s = bs.toStringUtf8();
1014         operator_ = s;
1015         return s;
1016       } else {
1017         return (java.lang.String) ref;
1018       }
1019     }
1020     /**
1021      *
1022      *
1023      * <pre>
1024      * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
1025      * Check the Operator enum for the list of possible values.
1026      * </pre>
1027      *
1028      * <code>optional string operator = 36317348;</code>
1029      *
1030      * @return The bytes for operator.
1031      */
getOperatorBytes()1032     public com.google.protobuf.ByteString getOperatorBytes() {
1033       java.lang.Object ref = operator_;
1034       if (ref instanceof String) {
1035         com.google.protobuf.ByteString b =
1036             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1037         operator_ = b;
1038         return b;
1039       } else {
1040         return (com.google.protobuf.ByteString) ref;
1041       }
1042     }
1043     /**
1044      *
1045      *
1046      * <pre>
1047      * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
1048      * Check the Operator enum for the list of possible values.
1049      * </pre>
1050      *
1051      * <code>optional string operator = 36317348;</code>
1052      *
1053      * @param value The operator to set.
1054      * @return This builder for chaining.
1055      */
setOperator(java.lang.String value)1056     public Builder setOperator(java.lang.String value) {
1057       if (value == null) {
1058         throw new NullPointerException();
1059       }
1060       operator_ = value;
1061       bitField0_ |= 0x00000002;
1062       onChanged();
1063       return this;
1064     }
1065     /**
1066      *
1067      *
1068      * <pre>
1069      * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
1070      * Check the Operator enum for the list of possible values.
1071      * </pre>
1072      *
1073      * <code>optional string operator = 36317348;</code>
1074      *
1075      * @return This builder for chaining.
1076      */
clearOperator()1077     public Builder clearOperator() {
1078       operator_ = getDefaultInstance().getOperator();
1079       bitField0_ = (bitField0_ & ~0x00000002);
1080       onChanged();
1081       return this;
1082     }
1083     /**
1084      *
1085      *
1086      * <pre>
1087      * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity.
1088      * Check the Operator enum for the list of possible values.
1089      * </pre>
1090      *
1091      * <code>optional string operator = 36317348;</code>
1092      *
1093      * @param value The bytes for operator to set.
1094      * @return This builder for chaining.
1095      */
setOperatorBytes(com.google.protobuf.ByteString value)1096     public Builder setOperatorBytes(com.google.protobuf.ByteString value) {
1097       if (value == null) {
1098         throw new NullPointerException();
1099       }
1100       checkByteStringIsUtf8(value);
1101       operator_ = value;
1102       bitField0_ |= 0x00000002;
1103       onChanged();
1104       return this;
1105     }
1106 
1107     private com.google.protobuf.LazyStringList values_ =
1108         com.google.protobuf.LazyStringArrayList.EMPTY;
1109 
ensureValuesIsMutable()1110     private void ensureValuesIsMutable() {
1111       if (!((bitField0_ & 0x00000004) != 0)) {
1112         values_ = new com.google.protobuf.LazyStringArrayList(values_);
1113         bitField0_ |= 0x00000004;
1114       }
1115     }
1116     /**
1117      *
1118      *
1119      * <pre>
1120      * Corresponds to the label values of Node resource.
1121      * </pre>
1122      *
1123      * <code>repeated string values = 249928994;</code>
1124      *
1125      * @return A list containing the values.
1126      */
getValuesList()1127     public com.google.protobuf.ProtocolStringList getValuesList() {
1128       return values_.getUnmodifiableView();
1129     }
1130     /**
1131      *
1132      *
1133      * <pre>
1134      * Corresponds to the label values of Node resource.
1135      * </pre>
1136      *
1137      * <code>repeated string values = 249928994;</code>
1138      *
1139      * @return The count of values.
1140      */
getValuesCount()1141     public int getValuesCount() {
1142       return values_.size();
1143     }
1144     /**
1145      *
1146      *
1147      * <pre>
1148      * Corresponds to the label values of Node resource.
1149      * </pre>
1150      *
1151      * <code>repeated string values = 249928994;</code>
1152      *
1153      * @param index The index of the element to return.
1154      * @return The values at the given index.
1155      */
getValues(int index)1156     public java.lang.String getValues(int index) {
1157       return values_.get(index);
1158     }
1159     /**
1160      *
1161      *
1162      * <pre>
1163      * Corresponds to the label values of Node resource.
1164      * </pre>
1165      *
1166      * <code>repeated string values = 249928994;</code>
1167      *
1168      * @param index The index of the value to return.
1169      * @return The bytes of the values at the given index.
1170      */
getValuesBytes(int index)1171     public com.google.protobuf.ByteString getValuesBytes(int index) {
1172       return values_.getByteString(index);
1173     }
1174     /**
1175      *
1176      *
1177      * <pre>
1178      * Corresponds to the label values of Node resource.
1179      * </pre>
1180      *
1181      * <code>repeated string values = 249928994;</code>
1182      *
1183      * @param index The index to set the value at.
1184      * @param value The values to set.
1185      * @return This builder for chaining.
1186      */
setValues(int index, java.lang.String value)1187     public Builder setValues(int index, java.lang.String value) {
1188       if (value == null) {
1189         throw new NullPointerException();
1190       }
1191       ensureValuesIsMutable();
1192       values_.set(index, value);
1193       onChanged();
1194       return this;
1195     }
1196     /**
1197      *
1198      *
1199      * <pre>
1200      * Corresponds to the label values of Node resource.
1201      * </pre>
1202      *
1203      * <code>repeated string values = 249928994;</code>
1204      *
1205      * @param value The values to add.
1206      * @return This builder for chaining.
1207      */
addValues(java.lang.String value)1208     public Builder addValues(java.lang.String value) {
1209       if (value == null) {
1210         throw new NullPointerException();
1211       }
1212       ensureValuesIsMutable();
1213       values_.add(value);
1214       onChanged();
1215       return this;
1216     }
1217     /**
1218      *
1219      *
1220      * <pre>
1221      * Corresponds to the label values of Node resource.
1222      * </pre>
1223      *
1224      * <code>repeated string values = 249928994;</code>
1225      *
1226      * @param values The values to add.
1227      * @return This builder for chaining.
1228      */
addAllValues(java.lang.Iterable<java.lang.String> values)1229     public Builder addAllValues(java.lang.Iterable<java.lang.String> values) {
1230       ensureValuesIsMutable();
1231       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, values_);
1232       onChanged();
1233       return this;
1234     }
1235     /**
1236      *
1237      *
1238      * <pre>
1239      * Corresponds to the label values of Node resource.
1240      * </pre>
1241      *
1242      * <code>repeated string values = 249928994;</code>
1243      *
1244      * @return This builder for chaining.
1245      */
clearValues()1246     public Builder clearValues() {
1247       values_ = com.google.protobuf.LazyStringArrayList.EMPTY;
1248       bitField0_ = (bitField0_ & ~0x00000004);
1249       onChanged();
1250       return this;
1251     }
1252     /**
1253      *
1254      *
1255      * <pre>
1256      * Corresponds to the label values of Node resource.
1257      * </pre>
1258      *
1259      * <code>repeated string values = 249928994;</code>
1260      *
1261      * @param value The bytes of the values to add.
1262      * @return This builder for chaining.
1263      */
addValuesBytes(com.google.protobuf.ByteString value)1264     public Builder addValuesBytes(com.google.protobuf.ByteString value) {
1265       if (value == null) {
1266         throw new NullPointerException();
1267       }
1268       checkByteStringIsUtf8(value);
1269       ensureValuesIsMutable();
1270       values_.add(value);
1271       onChanged();
1272       return this;
1273     }
1274 
1275     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1276     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1277       return super.setUnknownFields(unknownFields);
1278     }
1279 
1280     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1281     public final Builder mergeUnknownFields(
1282         final com.google.protobuf.UnknownFieldSet unknownFields) {
1283       return super.mergeUnknownFields(unknownFields);
1284     }
1285 
1286     // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.SchedulingNodeAffinity)
1287   }
1288 
1289   // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.SchedulingNodeAffinity)
1290   private static final com.google.cloud.compute.v1.SchedulingNodeAffinity DEFAULT_INSTANCE;
1291 
1292   static {
1293     DEFAULT_INSTANCE = new com.google.cloud.compute.v1.SchedulingNodeAffinity();
1294   }
1295 
getDefaultInstance()1296   public static com.google.cloud.compute.v1.SchedulingNodeAffinity getDefaultInstance() {
1297     return DEFAULT_INSTANCE;
1298   }
1299 
1300   private static final com.google.protobuf.Parser<SchedulingNodeAffinity> PARSER =
1301       new com.google.protobuf.AbstractParser<SchedulingNodeAffinity>() {
1302         @java.lang.Override
1303         public SchedulingNodeAffinity parsePartialFrom(
1304             com.google.protobuf.CodedInputStream input,
1305             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1306             throws com.google.protobuf.InvalidProtocolBufferException {
1307           Builder builder = newBuilder();
1308           try {
1309             builder.mergeFrom(input, extensionRegistry);
1310           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1311             throw e.setUnfinishedMessage(builder.buildPartial());
1312           } catch (com.google.protobuf.UninitializedMessageException e) {
1313             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1314           } catch (java.io.IOException e) {
1315             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1316                 .setUnfinishedMessage(builder.buildPartial());
1317           }
1318           return builder.buildPartial();
1319         }
1320       };
1321 
parser()1322   public static com.google.protobuf.Parser<SchedulingNodeAffinity> parser() {
1323     return PARSER;
1324   }
1325 
1326   @java.lang.Override
getParserForType()1327   public com.google.protobuf.Parser<SchedulingNodeAffinity> getParserForType() {
1328     return PARSER;
1329   }
1330 
1331   @java.lang.Override
getDefaultInstanceForType()1332   public com.google.cloud.compute.v1.SchedulingNodeAffinity getDefaultInstanceForType() {
1333     return DEFAULT_INSTANCE;
1334   }
1335 }
1336