Package com.google.cloud.language.v1
Enum EncodingType
- All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite,com.google.protobuf.ProtocolMessageEnum,Serializable,Comparable<EncodingType>
@Generated
public enum EncodingType
extends Enum<EncodingType>
implements com.google.protobuf.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 Summary
Enum ConstantsEnum ConstantDescriptionIf `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-16 encoding of the input.Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-32 encoding of the input.Encoding-dependent information (such as `begin_offset`) is calculated based on the UTF-8 encoding of the input. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIf `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.static final intEncoding-dependent information (such as `begin_offset`) is calculated based on the UTF-16 encoding of the input.static final intEncoding-dependent information (such as `begin_offset`) is calculated based on the UTF-32 encoding of the input.static final intEncoding-dependent information (such as `begin_offset`) is calculated based on the UTF-8 encoding of the input. -
Method Summary
Modifier and TypeMethodDescriptionstatic EncodingTypeforNumber(int value) static com.google.protobuf.Descriptors.EnumDescriptorfinal com.google.protobuf.Descriptors.EnumDescriptorfinal intfinal com.google.protobuf.Descriptors.EnumValueDescriptorstatic com.google.protobuf.Internal.EnumLiteMap<EncodingType>static EncodingTypevalueOf(int value) Deprecated.static EncodingTypevalueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) Returns the enum constant of this type with the specified name.static EncodingTypeReturns 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.
-
Enum Constant Details
-
NONE
If `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.
NONE = 0; -
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; -
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; -
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; -
UNRECOGNIZED
-
-
Field Details
-
NONE_VALUE
public static final int NONE_VALUEIf `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.
NONE = 0;- See Also:
-
UTF8_VALUE
public static final int UTF8_VALUEEncoding-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;- See Also:
-
UTF16_VALUE
public static final int UTF16_VALUEEncoding-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;- See Also:
-
UTF32_VALUE
public static final int UTF32_VALUEEncoding-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;- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getNumber
public final int getNumber()- Specified by:
getNumberin interfacecom.google.protobuf.Internal.EnumLite- Specified by:
getNumberin interfacecom.google.protobuf.ProtocolMessageEnum
-
valueOf
Deprecated.Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
value- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
forNumber
- Parameters:
value- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
-
getValueDescriptor
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()- Specified by:
getValueDescriptorin interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() -
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
desc- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-