Class ModalityTokenCount.Builder (1.36.0)

publicstaticfinalclass ModalityTokenCount.BuilderextendsGeneratedMessageV3.Builder<ModalityTokenCount.Builder>implementsModalityTokenCountOrBuilder

Represents token counting info for a single modality.

Protobuf type google.cloud.vertexai.v1.ModalityTokenCount

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicModalityTokenCount.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ModalityTokenCount.Builder
Overrides

build()

publicModalityTokenCountbuild()
Returns
Type Description
ModalityTokenCount

buildPartial()

publicModalityTokenCountbuildPartial()
Returns
Type Description
ModalityTokenCount

clear()

publicModalityTokenCount.Builderclear()
Returns
Type Description
ModalityTokenCount.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

publicModalityTokenCount.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ModalityTokenCount.Builder
Overrides

clearModality()

publicModalityTokenCount.BuilderclearModality()

The modality associated with this token count.

.google.cloud.vertexai.v1.Modality modality = 1;

Returns
Type Description
ModalityTokenCount.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicModalityTokenCount.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ModalityTokenCount.Builder
Overrides

clearTokenCount()

publicModalityTokenCount.BuilderclearTokenCount()

Number of tokens.

int32 token_count = 2;

Returns
Type Description
ModalityTokenCount.Builder

This builder for chaining.

clone()

publicModalityTokenCount.Builderclone()
Returns
Type Description
ModalityTokenCount.Builder
Overrides

getDefaultInstanceForType()

publicModalityTokenCountgetDefaultInstanceForType()
Returns
Type Description
ModalityTokenCount

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getModality()

publicModalitygetModality()

The modality associated with this token count.

.google.cloud.vertexai.v1.Modality modality = 1;

Returns
Type Description
Modality

The modality.

getModalityValue()

publicintgetModalityValue()

The modality associated with this token count.

.google.cloud.vertexai.v1.Modality modality = 1;

Returns
Type Description
int

The enum numeric value on the wire for modality.

getTokenCount()

publicintgetTokenCount()

Number of tokens.

int32 token_count = 2;

Returns
Type Description
int

The tokenCount.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ModalityTokenCount other)

publicModalityTokenCount.BuildermergeFrom(ModalityTokenCountother)
Parameter
Name Description
other ModalityTokenCount
Returns
Type Description
ModalityTokenCount.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicModalityTokenCount.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ModalityTokenCount.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicModalityTokenCount.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
ModalityTokenCount.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalModalityTokenCount.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ModalityTokenCount.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

publicModalityTokenCount.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ModalityTokenCount.Builder
Overrides

setModality(Modality value)

publicModalityTokenCount.BuildersetModality(Modalityvalue)

The modality associated with this token count.

.google.cloud.vertexai.v1.Modality modality = 1;

Parameter
Name Description
value Modality

The modality to set.

Returns
Type Description
ModalityTokenCount.Builder

This builder for chaining.

setModalityValue(int value)

publicModalityTokenCount.BuildersetModalityValue(intvalue)

The modality associated with this token count.

.google.cloud.vertexai.v1.Modality modality = 1;

Parameter
Name Description
value int

The enum numeric value on the wire for modality to set.

Returns
Type Description
ModalityTokenCount.Builder

This builder for chaining.

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

publicModalityTokenCount.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ModalityTokenCount.Builder
Overrides

setTokenCount(int value)

publicModalityTokenCount.BuildersetTokenCount(intvalue)

Number of tokens.

int32 token_count = 2;

Parameter
Name Description
value int

The tokenCount to set.

Returns
Type Description
ModalityTokenCount.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalModalityTokenCount.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ModalityTokenCount.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.