Package io.lettuce.core
Enum ScriptOutputType
- java.lang.Object
-
- java.lang.Enum<ScriptOutputType>
-
- io.lettuce.core.ScriptOutputType
-
- All Implemented Interfaces:
Serializable
,Comparable<ScriptOutputType>
public enum ScriptOutputType extends Enum<ScriptOutputType>
A Lua script returns one of the following types:BOOLEAN
booleanINTEGER
64-bit integerSTATUS
status stringVALUE
valueMULTI
of these typesOBJECT
result object defined by the RESP3 response
- Redis integer reply -> Lua number
- Redis bulk reply -> Lua string
- Redis multi bulk reply -> Lua table (may have other Redis data types nested)
- Redis status reply -> Lua table with a single
ok
field containing the status - Redis error reply -> Lua table with a single
err
field containing the error - Redis Nil bulk reply and Nil multi bulk reply -> Lua false boolean type
- Lua number -> Redis integer reply (the number is converted into an integer)
- Lua string -> Redis bulk reply
- Lua table (array) -> Redis multi bulk reply (truncated to the first
null
inside the Lua array if any) - Lua table with a single
ok
field -> Redis status reply - Lua table with a single
err
field -> Redis error reply - Lua boolean false -> Redis Nil bulk reply.
- Author:
- Will Glozer
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
Boolean output (expects a number0
or1
to be converted to a boolean value).INTEGER
integer
output.MULTI
List of flat arrays.OBJECT
RESP3-defined object output supporting all Redis response structures.STATUS
Simple status value such asOK
.VALUE
Value return type decoded throughRedisCodec.decodeValue(ByteBuffer)
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScriptOutputType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ScriptOutputType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final ScriptOutputType BOOLEAN
Boolean output (expects a number0
or1
to be converted to a boolean value).
-
INTEGER
public static final ScriptOutputType INTEGER
integer
output.
-
MULTI
public static final ScriptOutputType MULTI
List of flat arrays.
-
STATUS
public static final ScriptOutputType STATUS
Simple status value such asOK
. The Redis response is parsed as ASCII.
-
VALUE
public static final ScriptOutputType VALUE
Value return type decoded throughRedisCodec.decodeValue(ByteBuffer)
.
-
OBJECT
public static final ScriptOutputType OBJECT
RESP3-defined object output supporting all Redis response structures.
-
-
Method Detail
-
values
public static ScriptOutputType[] 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 (ScriptOutputType c : ScriptOutputType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ScriptOutputType valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-