Class Example (2.54.0)

public final class Example extends GeneratedMessageV3 implements ExampleOrBuilder

A sentence pair.

Protobuf type google.cloud.translation.v3.Example

Implements

ExampleOrBuilder

Static Fields

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_TEXT_FIELD_NUMBER

public static final int SOURCE_TEXT_FIELD_NUMBER
Field Value
Type Description
int

TARGET_TEXT_FIELD_NUMBER

public static final int TARGET_TEXT_FIELD_NUMBER
Field Value
Type Description
int

USAGE_FIELD_NUMBER

public static final int USAGE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Example getDefaultInstance()
Returns
Type Description
Example

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Example.Builder newBuilder()
Returns
Type Description
Example.Builder

newBuilder(Example prototype)

public static Example.Builder newBuilder(Example prototype)
Parameter
Name Description
prototype Example
Returns
Type Description
Example.Builder

parseDelimitedFrom(InputStream input)

public static Example parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Example
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Example parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Example
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Example parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Example
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Example parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Example
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Example parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Example
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Example parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Example
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Example parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Example
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Example parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Example
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Example parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Example
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Example parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Example
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Example parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Example
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Example parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Example
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Example> parser()
Returns
Type Description
Parser<Example>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Example getDefaultInstanceForType()
Returns
Type Description
Example

getName()

public String getName()

Output only. The resource name of the example, in form of projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. The resource name of the example, in form of projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<Example> getParserForType()
Returns
Type Description
Parser<Example>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSourceText()

public String getSourceText()

Sentence in source language.

string source_text = 2;

Returns
Type Description
String

The sourceText.

getSourceTextBytes()

public ByteString getSourceTextBytes()

Sentence in source language.

string source_text = 2;

Returns
Type Description
ByteString

The bytes for sourceText.

getTargetText()

public String getTargetText()

Sentence in target language.

string target_text = 3;

Returns
Type Description
String

The targetText.

getTargetTextBytes()

public ByteString getTargetTextBytes()

Sentence in target language.

string target_text = 3;

Returns
Type Description
ByteString

The bytes for targetText.

getUsage()

public String getUsage()

Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST.

string usage = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The usage.

getUsageBytes()

public ByteString getUsageBytes()

Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST.

string usage = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for usage.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Example.Builder newBuilderForType()
Returns
Type Description
Example.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Example.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Example.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Example.Builder toBuilder()
Returns
Type Description
Example.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException