Enum Class ProtoType

java.lang.Object
java.lang.Enum<ProtoType>
io.micronaut.serde.protobuf.annotation.ProtoType
All Implemented Interfaces:
Serializable, Comparable<ProtoType>, Constable

public enum ProtoType extends Enum<ProtoType>
The Protocol Buffers scalar types that can be requested for a property.

A single Java type maps to several possible wire representations. A Java int is int32 by default, but sint32 encodes negative values in a fifth of the bytes, and fixed32 is cheaper for values that are usually large.

This is prototype API and subject to change.

Since:
3.2
  • Enum Constant Details

    • DEFAULT

      public static final ProtoType DEFAULT
      Derive the wire representation from the Java type.
    • INT32

      public static final ProtoType INT32
      Variable-width signed 32-bit. Negative values always occupy ten bytes.
    • SINT32

      public static final ProtoType SINT32
      Variable-width 32-bit with zig-zag encoding. Efficient for negative values.
    • UINT32

      public static final ProtoType UINT32
      Variable-width unsigned 32-bit.
    • FIXED32

      public static final ProtoType FIXED32
      Fixed four-byte unsigned 32-bit.
    • SFIXED32

      public static final ProtoType SFIXED32
      Fixed four-byte signed 32-bit.
    • INT64

      public static final ProtoType INT64
      Variable-width signed 64-bit. Negative values always occupy ten bytes.
    • SINT64

      public static final ProtoType SINT64
      Variable-width 64-bit with zig-zag encoding. Efficient for negative values.
    • UINT64

      public static final ProtoType UINT64
      Variable-width unsigned 64-bit.
    • FIXED64

      public static final ProtoType FIXED64
      Fixed eight-byte unsigned 64-bit.
    • SFIXED64

      public static final ProtoType SFIXED64
      Fixed eight-byte signed 64-bit.
  • Method Details

    • values

      public static ProtoType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ProtoType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null