Enum WireType
- java.lang.Object
-
- java.lang.Enum<WireType>
-
- org.openstreetmap.josm.data.protobuf.WireType
-
-
Enum Constant Summary
Enum Constants Enum Constant Description LENGTH_DELIMITED
string, bytes, embedded messages, packed repeated fieldsSIXTY_FOUR_BIT
fixed64, sfixed64, doubleTHIRTY_TWO_BIT
fixed32, sfixed32, floatUNKNOWN
For unknown WireTypesVARINT
int32, int64, uint32, uint64, sing32, sint64, bool, enum
-
Field Summary
Fields Modifier and Type Field Description private static WireType[]
CACHED_VALUES
private byte
type
-
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 allWireType
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.
-
-
-
Enum Constant Detail
-
SIXTY_FOUR_BIT
public static final WireType SIXTY_FOUR_BIT
fixed64, sfixed64, double
-
LENGTH_DELIMITED
public static final WireType LENGTH_DELIMITED
string, bytes, embedded messages, packed repeated fields
-
THIRTY_TWO_BIT
public static final WireType THIRTY_TWO_BIT
fixed32, sfixed32, float
-
-
Field Detail
-
CACHED_VALUES
private static final WireType[] CACHED_VALUES
-
type
private final byte type
-
-
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 namejava.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 allWireType
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.
-
-