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