Enum Class ProtoType
- All Implemented Interfaces:
Serializable, Comparable<ProtoType>, Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDerive the wire representation from the Java type.Fixed four-byte unsigned 32-bit.Fixed eight-byte unsigned 64-bit.Variable-width signed 32-bit.Variable-width signed 64-bit.Fixed four-byte signed 32-bit.Fixed eight-byte signed 64-bit.Variable-width 32-bit with zig-zag encoding.Variable-width 64-bit with zig-zag encoding.Variable-width unsigned 32-bit.Variable-width unsigned 64-bit. -
Method Summary
-
Enum Constant Details
-
DEFAULT
Derive the wire representation from the Java type. -
INT32
Variable-width signed 32-bit. Negative values always occupy ten bytes. -
SINT32
Variable-width 32-bit with zig-zag encoding. Efficient for negative values. -
UINT32
Variable-width unsigned 32-bit. -
FIXED32
Fixed four-byte unsigned 32-bit. -
SFIXED32
Fixed four-byte signed 32-bit. -
INT64
Variable-width signed 64-bit. Negative values always occupy ten bytes. -
SINT64
Variable-width 64-bit with zig-zag encoding. Efficient for negative values. -
UINT64
Variable-width unsigned 64-bit. -
FIXED64
Fixed eight-byte unsigned 64-bit. -
SFIXED64
Fixed eight-byte signed 64-bit.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-