Enum WireType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<WireType>

    public enum WireType
    extends java.lang.Enum<WireType>
    The WireTypes
    Since:
    17862
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      LENGTH_DELIMITED
      string, bytes, embedded messages, packed repeated fields
      SIXTY_FOUR_BIT
      fixed64, sfixed64, double
      THIRTY_TWO_BIT
      fixed32, sfixed32, float
      UNKNOWN
      For unknown WireTypes
      VARINT
      int32, int64, uint32, uint64, sing32, sint64, bool, enum
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private WireType​(int value)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static WireType[] getAllValues()
      Get a pre-calculated array of all WireType values.
      byte getTypeRepresentation()
      Get the type representation (byte form)
      static WireType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static WireType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • WireType

        private WireType​(int value)
    • Method Detail

      • values

        public static WireType[] 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 (WireType c : WireType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static WireType valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getTypeRepresentation

        public byte getTypeRepresentation()
        Get the type representation (byte form)
        Returns:
        The wire type byte representation
      • getAllValues

        static WireType[] getAllValues()
        Get a pre-calculated array of all WireType values.
        Returns:
        An array of values, meant as a drop-in replacement for values() where the array is not modified! This can significantly reduce allocations, as there is no defensive array copy.