Enum 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 enum google.cloud.language.v2.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.
    • 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 name
        NullPointerException - if the argument is null
      • getNumber

        public final int getNumber()
        Specified by:
        getNumber in interface com.google.protobuf.Internal.EnumLite
        Specified by:
        getNumber in interface com.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 name
        NullPointerException - 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 interface com.google.protobuf.ProtocolMessageEnum
      • getDescriptorForType

        public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.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 name
        NullPointerException - if the argument is null