Package io.netty.handler.codec.redis
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>
@UnstableApi public enum RedisMessageType extends java.lang.Enum<RedisMessageType>
Type of RESP (REdis Serialization Protocol).
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ARRAY_HEADER
BULK_STRING
ERROR
INLINE_COMMAND
INTEGER
SIMPLE_STRING
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isInline()
Returnstrue
if this type is inline type, or returnsfalse
.int
length()
Returns length of this type.static RedisMessageType
readFrom(ByteBuf in, boolean decodeInlineCommands)
DetermineRedisMessageType
based on the type prefixbyte
read from given the buffer.static RedisMessageType
valueOf(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.void
writeTo(ByteBuf out)
Write the message type's prefix to the given buffer.
-
-
-
Enum Constant Detail
-
INLINE_COMMAND
public static final RedisMessageType INLINE_COMMAND
-
SIMPLE_STRING
public static final RedisMessageType SIMPLE_STRING
-
ERROR
public static final RedisMessageType ERROR
-
INTEGER
public static final RedisMessageType INTEGER
-
BULK_STRING
public static final RedisMessageType BULK_STRING
-
ARRAY_HEADER
public static final RedisMessageType ARRAY_HEADER
-
-
Method Detail
-
values
public static RedisMessageType[] 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 (RedisMessageType c : RedisMessageType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RedisMessageType 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
-
length
public int length()
Returns length of this type.
-
isInline
public boolean isInline()
Returnstrue
if this type is inline type, or returnsfalse
. If this istrue
, this type doesn't have length field.
-
readFrom
public static RedisMessageType readFrom(ByteBuf in, boolean decodeInlineCommands)
DetermineRedisMessageType
based on the type prefixbyte
read from given the buffer.
-
writeTo
public void writeTo(ByteBuf out)
Write the message type's prefix to the given buffer.
-
-