Class ModerateTextResponse (2.36.0)

public final class ModerateTextResponse extends GeneratedMessageV3 implements ModerateTextResponseOrBuilder

The document moderation response message.

Protobuf type google.cloud.language.v2.ModerateTextResponse

Static Fields

LANGUAGE_CODE_FIELD_NUMBER

public static final int LANGUAGE_CODE_FIELD_NUMBER
Field Value
TypeDescription
int

LANGUAGE_SUPPORTED_FIELD_NUMBER

public static final int LANGUAGE_SUPPORTED_FIELD_NUMBER
Field Value
TypeDescription
int

MODERATION_CATEGORIES_FIELD_NUMBER

public static final int MODERATION_CATEGORIES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static ModerateTextResponse getDefaultInstance()
Returns
TypeDescription
ModerateTextResponse

getDescriptor()

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

newBuilder()

public static ModerateTextResponse.Builder newBuilder()
Returns
TypeDescription
ModerateTextResponse.Builder

newBuilder(ModerateTextResponse prototype)

public static ModerateTextResponse.Builder newBuilder(ModerateTextResponse prototype)
Parameter
NameDescription
prototypeModerateTextResponse
Returns
TypeDescription
ModerateTextResponse.Builder

parseDelimitedFrom(InputStream input)

public static ModerateTextResponse parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ModerateTextResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static ModerateTextResponse parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ModerateTextResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ModerateTextResponse parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ModerateTextResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ModerateTextResponse parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ModerateTextResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static ModerateTextResponse parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ModerateTextResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static ModerateTextResponse parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ModerateTextResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ModerateTextResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<ModerateTextResponse> parser()
Returns
TypeDescription
Parser<ModerateTextResponse>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public ModerateTextResponse getDefaultInstanceForType()
Returns
TypeDescription
ModerateTextResponse

getLanguageCode()

public String getLanguageCode()

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][] field for more details.

string language_code = 2;

Returns
TypeDescription
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

The language of the text, which will be the same as the language specified in the request or, if not specified, the automatically-detected language. See [Document.language][] field for more details.

string language_code = 2;

Returns
TypeDescription
ByteString

The bytes for languageCode.

getLanguageSupported()

public boolean getLanguageSupported()

Whether the language is officially supported. The API may still return a response when the language is not supported, but it is on a best effort basis.

bool language_supported = 3;

Returns
TypeDescription
boolean

The languageSupported.

getModerationCategories(int index)

public ClassificationCategory getModerationCategories(int index)

Harmful and sensitive categories representing the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategory

getModerationCategoriesCount()

public int getModerationCategoriesCount()

Harmful and sensitive categories representing the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 1;

Returns
TypeDescription
int

getModerationCategoriesList()

public List<ClassificationCategory> getModerationCategoriesList()

Harmful and sensitive categories representing the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 1;

Returns
TypeDescription
List<ClassificationCategory>

getModerationCategoriesOrBuilder(int index)

public ClassificationCategoryOrBuilder getModerationCategoriesOrBuilder(int index)

Harmful and sensitive categories representing the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
ClassificationCategoryOrBuilder

getModerationCategoriesOrBuilderList()

public List<? extends ClassificationCategoryOrBuilder> getModerationCategoriesOrBuilderList()

Harmful and sensitive categories representing the input document.

repeated .google.cloud.language.v2.ClassificationCategory moderation_categories = 1;

Returns
TypeDescription
List<? extends com.google.cloud.language.v2.ClassificationCategoryOrBuilder>

getParserForType()

public Parser<ModerateTextResponse> getParserForType()
Returns
TypeDescription
Parser<ModerateTextResponse>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public ModerateTextResponse.Builder newBuilderForType()
Returns
TypeDescription
ModerateTextResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ModerateTextResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
ModerateTextResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public ModerateTextResponse.Builder toBuilder()
Returns
TypeDescription
ModerateTextResponse.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException