- All Implemented Interfaces:
Serializable, Comparable<Decoder.Type>, java.lang.constant.Constable
- Enclosing class:
Decoder
Enumeration of data types supported in MaxMind DB format.
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionArray typeBoolean typeBytes typeContainer typeDouble typeEnd markerExtended typeFloat typeSigned 32-bit integerMap typePointer typeUnsigned 128-bit integerUnsigned 16-bit integerUnsigned 32-bit integerUnsigned 64-bit integerUTF-8 string typeField Summary
FieldsModifier and TypeFieldDescription(package private) static final Decoder.Type[]Cached copy of Type.values(), to avoid the array clone on every lookup.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionstatic Decoder.TypefromControlByte(int b) Determine the data type encoded in the leading bits of a control byte.private static Decoder.Typeget(byte b) Returns the type described by a control byte.static Decoder.Typeget(int i) Return the data type stored at an index in this enum's declaration order.static Decoder.TypeReturns the enum constant of this class with the specified name.static Decoder.Type[]values()Returns an array containing the constants of this enum class, in the order they are declared.
Enum Constant Details
EXTENDED
Extended typePOINTER
Pointer typeUTF8_STRING
UTF-8 string typeDOUBLE
Double typeBYTES
Bytes typeUINT16
Unsigned 16-bit integerUINT32
Unsigned 32-bit integerMAP
Map typeINT32
Signed 32-bit integerUINT64
Unsigned 64-bit integerUINT128
Unsigned 128-bit integerARRAY
Array typeCONTAINER
Container typeEND_MARKER
End markerBOOLEAN
Boolean typeFLOAT
Float type
Field Details
values
Cached copy of Type.values(), to avoid the array clone on every lookup. Worth about 5000 requests per second on the original author's machine.
Constructor Details
Type
private Type()
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
get
Return the data type stored at an index in this enum's declaration order.- Parameters:
i- the zero-based index into the Type values array- Returns:
- the Type constant at that index
get
Returns the type described by a control byte.- Parameters:
b- the control byte to interpret- Returns:
- the type and its payload size
fromControlByte
Determine the data type encoded in the leading bits of a control byte.- Parameters:
b- the control byte, whose top 3 bits encode the data type- Returns:
- the type encoded in the top 3 bits of b