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