Enum Class Resp3Type
- All Implemented Interfaces:
Serializable,Comparable<Resp3Type>,Constable,SerializationHint,SerializationHint.SimpleHint
This enumeration includes a subset of the types available in RESP3, including unknown types. The types help to identify the RESP3 correspondent type for nested data structures, such as lists and maps. The hints only work for 1-level nested objects. Deeply nested or heterogeneous structures utilize an unknown hint and search the registry for a match.
The type only covers the primitive types in RESP. We do not include nested objects here. If a nested object is needed,
utilize the appropriate method in ResponseWriter and provide a JavaObjectSerializer to serialize.
- Author:
- José Bolina
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface org.infinispan.server.resp.serialization.SerializationHint
SerializationHint.KeyValueHint, SerializationHint.SimpleHint -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAny type of string.Rational numbers represented by float or double.Integer numbers represented by 64-bits.Strings which do not contain any of the escape characters ('\n' or '\r'). -
Method Summary
Modifier and TypeMethodDescriptionabstract voidserialize(Object object, ResponseWriter writer) Delegates the serialization to a specific method.static Resp3TypeReturns the enum constant of this class with the specified name.static Resp3Type[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SIMPLE_STRING
Strings which do not contain any of the escape characters ('\n' or '\r').- See Also:
-
BULK_STRING
Any type of string.- See Also:
-
INTEGER
Integer numbers represented by 64-bits.- See Also:
-
DOUBLE
Rational numbers represented by float or double.- See Also:
-
-
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
-
serialize
Delegates the serialization to a specific method.This approach avoids introspecting all the registered serializes in the system. In the worst case, it defaults to the unknown approach, and traverse the complete serializer list.
- Specified by:
serializein interfaceSerializationHint.SimpleHint- Parameters:
object- The element to serialize.writer- The allocator to utilize.
-