@java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (modality_ != com.google.cloud.vertexai.api.Modality.MODALITY_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, modality_);
    }
    if (tokenCount_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, tokenCount_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }
<pre>
Number of tokens.
</pre>

<code>int32 token_count = 2;</code>

@return The tokenCount.
java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/ModalityTokenCount.java