Enum RedisMessageType
java.lang.Object
java.lang.Enum<RedisMessageType>
io.netty.handler.codec.redis.RedisMessageType
- All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<RedisMessageType>
Type of RESP (REdis Serialization Protocol).
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisInline()Returnstrueif this type is inline type, or returnsfalse.intlength()Returns length of this type.static RedisMessageTypeDetermineRedisMessageTypebased on the type prefixbyteread from given the buffer.private static RedisMessageTypevalueOf(byte value) Returns the enum constant of this type with the specified name.static RedisMessageTypevalueOf(java.lang.String name) Returns the enum constant of this type with the specified name.static RedisMessageType[]values()Returns an array containing the constants of this enum type, in the order they are declared.voidWrite the message type's prefix to the given buffer.Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
Enum Constant Details
-
INLINE_COMMAND
-
SIMPLE_STRING
-
ERROR
-
INTEGER
-
BULK_STRING
-
ARRAY_HEADER
-
-
Field Details
-
value
private final java.lang.Byte value -
inline
private final boolean inline
-
-
Constructor Details
-
RedisMessageType
private RedisMessageType(java.lang.Byte value, boolean inline)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
length
public int length()Returns length of this type. -
isInline
public boolean isInline()Returnstrueif this type is inline type, or returnsfalse. If this istrue, this type doesn't have length field. -
readFrom
DetermineRedisMessageTypebased on the type prefixbyteread from given the buffer. -
writeTo
Write the message type's prefix to the given buffer. -
valueOf
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:
value- 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
-