Class RecognizeResponse.Builder (4.24.0)

public static final class RecognizeResponse.Builder extends GeneratedMessageV3.Builder<RecognizeResponse.Builder> implements RecognizeResponseOrBuilder

The only message returned to the client by the Recognize method. It contains the result as zero or more sequential SpeechRecognitionResult messages.

Protobuf type google.cloud.speech.v1p1beta1.RecognizeResponse

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllResults(Iterable<? extends SpeechRecognitionResult> values)

public RecognizeResponse.Builder addAllResults(Iterable<? extends SpeechRecognitionResult> values)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult>
Returns
TypeDescription
RecognizeResponse.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public RecognizeResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

addResults(SpeechRecognitionResult value)

public RecognizeResponse.Builder addResults(SpeechRecognitionResult value)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameter
NameDescription
valueSpeechRecognitionResult
Returns
TypeDescription
RecognizeResponse.Builder

addResults(SpeechRecognitionResult.Builder builderForValue)

public RecognizeResponse.Builder addResults(SpeechRecognitionResult.Builder builderForValue)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameter
NameDescription
builderForValueSpeechRecognitionResult.Builder
Returns
TypeDescription
RecognizeResponse.Builder

addResults(int index, SpeechRecognitionResult value)

public RecognizeResponse.Builder addResults(int index, SpeechRecognitionResult value)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameters
NameDescription
indexint
valueSpeechRecognitionResult
Returns
TypeDescription
RecognizeResponse.Builder

addResults(int index, SpeechRecognitionResult.Builder builderForValue)

public RecognizeResponse.Builder addResults(int index, SpeechRecognitionResult.Builder builderForValue)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameters
NameDescription
indexint
builderForValueSpeechRecognitionResult.Builder
Returns
TypeDescription
RecognizeResponse.Builder

addResultsBuilder()

public SpeechRecognitionResult.Builder addResultsBuilder()

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Returns
TypeDescription
SpeechRecognitionResult.Builder

addResultsBuilder(int index)

public SpeechRecognitionResult.Builder addResultsBuilder(int index)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SpeechRecognitionResult.Builder

build()

public RecognizeResponse build()
Returns
TypeDescription
RecognizeResponse

buildPartial()

public RecognizeResponse buildPartial()
Returns
TypeDescription
RecognizeResponse

clear()

public RecognizeResponse.Builder clear()
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public RecognizeResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public RecognizeResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

clearRequestId()

public RecognizeResponse.Builder clearRequestId()

The ID associated with the request. This is a unique ID specific only to the given request.

int64 request_id = 8;

Returns
TypeDescription
RecognizeResponse.Builder

This builder for chaining.

clearResults()

public RecognizeResponse.Builder clearResults()

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Returns
TypeDescription
RecognizeResponse.Builder

clearSpeechAdaptationInfo()

public RecognizeResponse.Builder clearSpeechAdaptationInfo()

Provides information on adaptation behavior in response

.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7;

Returns
TypeDescription
RecognizeResponse.Builder

clearTotalBilledTime()

public RecognizeResponse.Builder clearTotalBilledTime()

When available, billed audio seconds for the corresponding request.

.google.protobuf.Duration total_billed_time = 3;

Returns
TypeDescription
RecognizeResponse.Builder

clone()

public RecognizeResponse.Builder clone()
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

getDefaultInstanceForType()

public RecognizeResponse getDefaultInstanceForType()
Returns
TypeDescription
RecognizeResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getRequestId()

public long getRequestId()

The ID associated with the request. This is a unique ID specific only to the given request.

int64 request_id = 8;

Returns
TypeDescription
long

The requestId.

getResults(int index)

public SpeechRecognitionResult getResults(int index)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SpeechRecognitionResult

getResultsBuilder(int index)

public SpeechRecognitionResult.Builder getResultsBuilder(int index)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SpeechRecognitionResult.Builder

getResultsBuilderList()

public List<SpeechRecognitionResult.Builder> getResultsBuilderList()

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Returns
TypeDescription
List<Builder>

getResultsCount()

public int getResultsCount()

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Returns
TypeDescription
int

getResultsList()

public List<SpeechRecognitionResult> getResultsList()

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Returns
TypeDescription
List<SpeechRecognitionResult>

getResultsOrBuilder(int index)

public SpeechRecognitionResultOrBuilder getResultsOrBuilder(int index)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
SpeechRecognitionResultOrBuilder

getResultsOrBuilderList()

public List<? extends SpeechRecognitionResultOrBuilder> getResultsOrBuilderList()

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Returns
TypeDescription
List<? extends com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder>

getSpeechAdaptationInfo()

public SpeechAdaptationInfo getSpeechAdaptationInfo()

Provides information on adaptation behavior in response

.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7;

Returns
TypeDescription
SpeechAdaptationInfo

The speechAdaptationInfo.

getSpeechAdaptationInfoBuilder()

public SpeechAdaptationInfo.Builder getSpeechAdaptationInfoBuilder()

Provides information on adaptation behavior in response

.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7;

Returns
TypeDescription
SpeechAdaptationInfo.Builder

getSpeechAdaptationInfoOrBuilder()

public SpeechAdaptationInfoOrBuilder getSpeechAdaptationInfoOrBuilder()

Provides information on adaptation behavior in response

.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7;

Returns
TypeDescription
SpeechAdaptationInfoOrBuilder

getTotalBilledTime()

public Duration getTotalBilledTime()

When available, billed audio seconds for the corresponding request.

.google.protobuf.Duration total_billed_time = 3;

Returns
TypeDescription
Duration

The totalBilledTime.

getTotalBilledTimeBuilder()

public Duration.Builder getTotalBilledTimeBuilder()

When available, billed audio seconds for the corresponding request.

.google.protobuf.Duration total_billed_time = 3;

Returns
TypeDescription
Builder

getTotalBilledTimeOrBuilder()

public DurationOrBuilder getTotalBilledTimeOrBuilder()

When available, billed audio seconds for the corresponding request.

.google.protobuf.Duration total_billed_time = 3;

Returns
TypeDescription
DurationOrBuilder

hasSpeechAdaptationInfo()

public boolean hasSpeechAdaptationInfo()

Provides information on adaptation behavior in response

.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7;

Returns
TypeDescription
boolean

Whether the speechAdaptationInfo field is set.

hasTotalBilledTime()

public boolean hasTotalBilledTime()

When available, billed audio seconds for the corresponding request.

.google.protobuf.Duration total_billed_time = 3;

Returns
TypeDescription
boolean

Whether the totalBilledTime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(RecognizeResponse other)

public RecognizeResponse.Builder mergeFrom(RecognizeResponse other)
Parameter
NameDescription
otherRecognizeResponse
Returns
TypeDescription
RecognizeResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public RecognizeResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
RecognizeResponse.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public RecognizeResponse.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

mergeSpeechAdaptationInfo(SpeechAdaptationInfo value)

public RecognizeResponse.Builder mergeSpeechAdaptationInfo(SpeechAdaptationInfo value)

Provides information on adaptation behavior in response

.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7;

Parameter
NameDescription
valueSpeechAdaptationInfo
Returns
TypeDescription
RecognizeResponse.Builder

mergeTotalBilledTime(Duration value)

public RecognizeResponse.Builder mergeTotalBilledTime(Duration value)

When available, billed audio seconds for the corresponding request.

.google.protobuf.Duration total_billed_time = 3;

Parameter
NameDescription
valueDuration
Returns
TypeDescription
RecognizeResponse.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final RecognizeResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

removeResults(int index)

public RecognizeResponse.Builder removeResults(int index)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
RecognizeResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public RecognizeResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public RecognizeResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
RecognizeResponse.Builder
Overrides

setRequestId(long value)

public RecognizeResponse.Builder setRequestId(long value)

The ID associated with the request. This is a unique ID specific only to the given request.

int64 request_id = 8;

Parameter
NameDescription
valuelong

The requestId to set.

Returns
TypeDescription
RecognizeResponse.Builder

This builder for chaining.

setResults(int index, SpeechRecognitionResult value)

public RecognizeResponse.Builder setResults(int index, SpeechRecognitionResult value)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameters
NameDescription
indexint
valueSpeechRecognitionResult
Returns
TypeDescription
RecognizeResponse.Builder

setResults(int index, SpeechRecognitionResult.Builder builderForValue)

public RecognizeResponse.Builder setResults(int index, SpeechRecognitionResult.Builder builderForValue)

Sequential list of transcription results corresponding to sequential portions of audio.

repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2;

Parameters
NameDescription
indexint
builderForValueSpeechRecognitionResult.Builder
Returns
TypeDescription
RecognizeResponse.Builder

setSpeechAdaptationInfo(SpeechAdaptationInfo value)

public RecognizeResponse.Builder setSpeechAdaptationInfo(SpeechAdaptationInfo value)

Provides information on adaptation behavior in response

.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7;

Parameter
NameDescription
valueSpeechAdaptationInfo
Returns
TypeDescription
RecognizeResponse.Builder

setSpeechAdaptationInfo(SpeechAdaptationInfo.Builder builderForValue)

public RecognizeResponse.Builder setSpeechAdaptationInfo(SpeechAdaptationInfo.Builder builderForValue)

Provides information on adaptation behavior in response

.google.cloud.speech.v1p1beta1.SpeechAdaptationInfo speech_adaptation_info = 7;

Parameter
NameDescription
builderForValueSpeechAdaptationInfo.Builder
Returns
TypeDescription
RecognizeResponse.Builder

setTotalBilledTime(Duration value)

public RecognizeResponse.Builder setTotalBilledTime(Duration value)

When available, billed audio seconds for the corresponding request.

.google.protobuf.Duration total_billed_time = 3;

Parameter
NameDescription
valueDuration
Returns
TypeDescription
RecognizeResponse.Builder

setTotalBilledTime(Duration.Builder builderForValue)

public RecognizeResponse.Builder setTotalBilledTime(Duration.Builder builderForValue)

When available, billed audio seconds for the corresponding request.

.google.protobuf.Duration total_billed_time = 3;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
RecognizeResponse.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final RecognizeResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
RecognizeResponse.Builder
Overrides