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