Class TokensInfo.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<TokensInfo.Builder>
com.google.cloud.aiplatform.v1.TokensInfo.Builder
All Implemented Interfaces:
TokensInfoOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
TokensInfo

public static final class TokensInfo.Builder extends com.google.protobuf.GeneratedMessage.Builder<TokensInfo.Builder> implements TokensInfoOrBuilder
 Tokens info with a list of tokens and the corresponding list of token ids.
 
Protobuf type google.cloud.aiplatform.v1.TokensInfo
  • Method Summary

    Modifier and Type
    Method
    Description
    addAllTokenIds(Iterable<? extends Long> values)
    A list of token ids from the input.
    addAllTokens(Iterable<? extends com.google.protobuf.ByteString> values)
    A list of tokens from the input.
    addTokenIds(long value)
    A list of token ids from the input.
    addTokens(com.google.protobuf.ByteString value)
    A list of tokens from the input.
     
     
     
    Optional.
    A list of token ids from the input.
    A list of tokens from the input.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    Optional.
    com.google.protobuf.ByteString
    Optional.
    long
    getTokenIds(int index)
    A list of token ids from the input.
    int
    A list of token ids from the input.
    A list of token ids from the input.
    com.google.protobuf.ByteString
    getTokens(int index)
    A list of tokens from the input.
    int
    A list of tokens from the input.
    List<com.google.protobuf.ByteString>
    A list of tokens from the input.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    setRole(String value)
    Optional.
    setRoleBytes(com.google.protobuf.ByteString value)
    Optional.
    setTokenIds(int index, long value)
    A list of token ids from the input.
    setTokens(int index, com.google.protobuf.ByteString value)
    A list of tokens from the input.

    Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

    addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<TokensInfo.Builder>
    • clear

      public TokensInfo.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<TokensInfo.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<TokensInfo.Builder>
    • getDefaultInstanceForType

      public TokensInfo getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public TokensInfo build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public TokensInfo buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public TokensInfo.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TokensInfo.Builder>
    • mergeFrom

      public TokensInfo.Builder mergeFrom(TokensInfo other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<TokensInfo.Builder>
    • mergeFrom

      public TokensInfo.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TokensInfo.Builder>
      Throws:
      IOException
    • getTokensList

      public List<com.google.protobuf.ByteString> getTokensList()
       A list of tokens from the input.
       
      repeated bytes tokens = 1;
      Specified by:
      getTokensList in interface TokensInfoOrBuilder
      Returns:
      A list containing the tokens.
    • getTokensCount

      public int getTokensCount()
       A list of tokens from the input.
       
      repeated bytes tokens = 1;
      Specified by:
      getTokensCount in interface TokensInfoOrBuilder
      Returns:
      The count of tokens.
    • getTokens

      public com.google.protobuf.ByteString getTokens(int index)
       A list of tokens from the input.
       
      repeated bytes tokens = 1;
      Specified by:
      getTokens in interface TokensInfoOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The tokens at the given index.
    • setTokens

      public TokensInfo.Builder setTokens(int index, com.google.protobuf.ByteString value)
       A list of tokens from the input.
       
      repeated bytes tokens = 1;
      Parameters:
      index - The index to set the value at.
      value - The tokens to set.
      Returns:
      This builder for chaining.
    • addTokens

      public TokensInfo.Builder addTokens(com.google.protobuf.ByteString value)
       A list of tokens from the input.
       
      repeated bytes tokens = 1;
      Parameters:
      value - The tokens to add.
      Returns:
      This builder for chaining.
    • addAllTokens

      public TokensInfo.Builder addAllTokens(Iterable<? extends com.google.protobuf.ByteString> values)
       A list of tokens from the input.
       
      repeated bytes tokens = 1;
      Parameters:
      values - The tokens to add.
      Returns:
      This builder for chaining.
    • clearTokens

      public TokensInfo.Builder clearTokens()
       A list of tokens from the input.
       
      repeated bytes tokens = 1;
      Returns:
      This builder for chaining.
    • getTokenIdsList

      public List<Long> getTokenIdsList()
       A list of token ids from the input.
       
      repeated int64 token_ids = 2;
      Specified by:
      getTokenIdsList in interface TokensInfoOrBuilder
      Returns:
      A list containing the tokenIds.
    • getTokenIdsCount

      public int getTokenIdsCount()
       A list of token ids from the input.
       
      repeated int64 token_ids = 2;
      Specified by:
      getTokenIdsCount in interface TokensInfoOrBuilder
      Returns:
      The count of tokenIds.
    • getTokenIds

      public long getTokenIds(int index)
       A list of token ids from the input.
       
      repeated int64 token_ids = 2;
      Specified by:
      getTokenIds in interface TokensInfoOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The tokenIds at the given index.
    • setTokenIds

      public TokensInfo.Builder setTokenIds(int index, long value)
       A list of token ids from the input.
       
      repeated int64 token_ids = 2;
      Parameters:
      index - The index to set the value at.
      value - The tokenIds to set.
      Returns:
      This builder for chaining.
    • addTokenIds

      public TokensInfo.Builder addTokenIds(long value)
       A list of token ids from the input.
       
      repeated int64 token_ids = 2;
      Parameters:
      value - The tokenIds to add.
      Returns:
      This builder for chaining.
    • addAllTokenIds

      public TokensInfo.Builder addAllTokenIds(Iterable<? extends Long> values)
       A list of token ids from the input.
       
      repeated int64 token_ids = 2;
      Parameters:
      values - The tokenIds to add.
      Returns:
      This builder for chaining.
    • clearTokenIds

      public TokensInfo.Builder clearTokenIds()
       A list of token ids from the input.
       
      repeated int64 token_ids = 2;
      Returns:
      This builder for chaining.
    • getRole

      public String getRole()
       Optional. Optional fields for the role from the corresponding Content.
       
      string role = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getRole in interface TokensInfoOrBuilder
      Returns:
      The role.
    • getRoleBytes

      public com.google.protobuf.ByteString getRoleBytes()
       Optional. Optional fields for the role from the corresponding Content.
       
      string role = 3 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getRoleBytes in interface TokensInfoOrBuilder
      Returns:
      The bytes for role.
    • setRole

      public TokensInfo.Builder setRole(String value)
       Optional. Optional fields for the role from the corresponding Content.
       
      string role = 3 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The role to set.
      Returns:
      This builder for chaining.
    • clearRole

      public TokensInfo.Builder clearRole()
       Optional. Optional fields for the role from the corresponding Content.
       
      string role = 3 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setRoleBytes

      public TokensInfo.Builder setRoleBytes(com.google.protobuf.ByteString value)
       Optional. Optional fields for the role from the corresponding Content.
       
      string role = 3 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for role to set.
      Returns:
      This builder for chaining.