public enum EncodingType extends java.lang.Enum<EncodingType> implements ProtocolMessageEnum
Represents the text encoding that the caller uses to process the output. Providing an `EncodingType` is recommended because the API provides the beginning offsets for various outputs, such as tokens and mentions, and languages that natively use different text encodings may access offsets differently.Protobuf enum
google.cloud.language.v1.EncodingType
Enum Constant and Description |
---|
NONE
If `EncodingType` is not specified, encoding-dependent information (such as
`begin_offset`) will be set at `-1`.
|
UNRECOGNIZED |
UTF16
Encoding-dependent information (such as `begin_offset`) is calculated based
on the UTF-16 encoding of the input.
|
UTF32
Encoding-dependent information (such as `begin_offset`) is calculated based
on the UTF-32 encoding of the input.
|
UTF8
Encoding-dependent information (such as `begin_offset`) is calculated based
on the UTF-8 encoding of the input.
|
Modifier and Type | Field and Description |
---|---|
static int |
NONE_VALUE
If `EncodingType` is not specified, encoding-dependent information (such as
`begin_offset`) will be set at `-1`.
|
static int |
UTF16_VALUE
Encoding-dependent information (such as `begin_offset`) is calculated based
on the UTF-16 encoding of the input.
|
static int |
UTF32_VALUE
Encoding-dependent information (such as `begin_offset`) is calculated based
on the UTF-32 encoding of the input.
|
static int |
UTF8_VALUE
Encoding-dependent information (such as `begin_offset`) is calculated based
on the UTF-8 encoding of the input.
|
Modifier and Type | Method and Description |
---|---|
static EncodingType |
forNumber(int value) |
static Descriptors.EnumDescriptor |
getDescriptor() |
Descriptors.EnumDescriptor |
getDescriptorForType() |
int |
getNumber() |
Descriptors.EnumValueDescriptor |
getValueDescriptor() |
static Internal.EnumLiteMap<EncodingType> |
internalGetValueMap() |
static EncodingType |
valueOf(Descriptors.EnumValueDescriptor desc) |
static EncodingType |
valueOf(int value)
Deprecated.
Use
forNumber(int) instead. |
static EncodingType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static EncodingType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EncodingType NONE
If `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.
NONE = 0;
public static final EncodingType UTF8
Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-8 encoding of the input. C++ and Go are examples of languages that use this encoding natively.
UTF8 = 1;
public static final EncodingType UTF16
Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-16 encoding of the input. Java and Javascript are examples of languages that use this encoding natively.
UTF16 = 2;
public static final EncodingType UTF32
Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-32 encoding of the input. Python is an example of a language that uses this encoding natively.
UTF32 = 3;
public static final EncodingType UNRECOGNIZED
public static final int NONE_VALUE
If `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.
NONE = 0;
public static final int UTF8_VALUE
Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-8 encoding of the input. C++ and Go are examples of languages that use this encoding natively.
UTF8 = 1;
public static final int UTF16_VALUE
Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-16 encoding of the input. Java and Javascript are examples of languages that use this encoding natively.
UTF16 = 2;
public static final int UTF32_VALUE
Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-32 encoding of the input. Python is an example of a language that uses this encoding natively.
UTF32 = 3;
public static EncodingType[] values()
for (EncodingType c : EncodingType.values()) System.out.println(c);
public static EncodingType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final int getNumber()
getNumber
in interface Internal.EnumLite
getNumber
in interface ProtocolMessageEnum
@Deprecated public static EncodingType valueOf(int value)
forNumber(int)
instead.public static EncodingType forNumber(int value)
public static Internal.EnumLiteMap<EncodingType> internalGetValueMap()
public final Descriptors.EnumValueDescriptor getValueDescriptor()
getValueDescriptor
in interface ProtocolMessageEnum
public final Descriptors.EnumDescriptor getDescriptorForType()
getDescriptorForType
in interface ProtocolMessageEnum
public static final Descriptors.EnumDescriptor getDescriptor()
public static EncodingType valueOf(Descriptors.EnumValueDescriptor desc)