Enum EncodingType
- java.lang.Object
-
- java.lang.Enum<EncodingType>
-
- com.google.cloud.language.v1beta2.EncodingType
-
- All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite
,com.google.protobuf.ProtocolMessageEnum
,Serializable
,Comparable<EncodingType>
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 enumgoogle.cloud.language.v1beta2.EncodingType
-
-
Enum Constant Summary
Enum Constants Enum Constant 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.
-
Field Summary
Fields Modifier and Type Field 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static EncodingType
forNumber(int value)
static com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor()
com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType()
int
getNumber()
com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor()
static com.google.protobuf.Internal.EnumLiteMap<EncodingType>
internalGetValueMap()
static EncodingType
valueOf(int value)
Deprecated.static EncodingType
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
Returns the enum constant of this type with the specified name.static EncodingType
valueOf(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.
-
-
-
Enum Constant Detail
-
NONE
public static final EncodingType NONE
If `EncodingType` is not specified, encoding-dependent information (such as `begin_offset`) will be set at `-1`.
NONE = 0;
-
UTF8
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;
-
UTF16
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;
-
UTF32
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;
-
UNRECOGNIZED
public static final EncodingType UNRECOGNIZED
-
-
Field Detail
-
NONE_VALUE
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;
- See Also:
- Constant Field Values
-
UTF8_VALUE
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;
- See Also:
- Constant Field Values
-
UTF16_VALUE
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;
- See Also:
- Constant Field Values
-
UTF32_VALUE
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;
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static EncodingType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EncodingType c : EncodingType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EncodingType valueOf(String name)
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:
getNumber
in interfacecom.google.protobuf.Internal.EnumLite
- Specified by:
getNumber
in interfacecom.google.protobuf.ProtocolMessageEnum
-
valueOf
@Deprecated public static EncodingType valueOf(int value)
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
public static EncodingType forNumber(int value)
- Parameters:
value
- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
public static com.google.protobuf.Internal.EnumLiteMap<EncodingType> internalGetValueMap()
-
getValueDescriptor
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
- Specified by:
getValueDescriptor
in interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
-
valueOf
public static EncodingType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
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
-
-