Package io.lettuce.core.dynamic
Class DeclaredCommandMethod
- java.lang.Object
-
- io.lettuce.core.dynamic.DeclaredCommandMethod
-
- All Implemented Interfaces:
CommandMethod
public class DeclaredCommandMethod extends Object implements CommandMethod
Abstraction of a method that is designated to execute a Redis command method. Enriches the standardMethod
interface with specific information that is necessary to constructRedisCommand
for the method.- Since:
- 5.0
- Author:
- Mark Paluch
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CommandMethod
create(Method method)
Create a newDeclaredCommandMethod
given aMethod
.boolean
equals(Object o)
ResolvableType
getActualReturnType()
<A extends Annotation>
AgetAnnotation(Class<A> annotationClass)
Lookup a method annotation.Method
getMethod()
String
getName()
Parameters<? extends Parameter>
getParameters()
ResolvableType
getReturnType()
boolean
hasAnnotation(Class<? extends Annotation> annotationClass)
int
hashCode()
boolean
isBatchExecution()
boolean
isFutureExecution()
boolean
isReactiveExecution()
String
toString()
-
-
-
Method Detail
-
create
public static CommandMethod create(Method method)
Create a newDeclaredCommandMethod
given aMethod
.- Parameters:
method
- must not be null.
-
getParameters
public Parameters<? extends Parameter> getParameters()
- Specified by:
getParameters
in interfaceCommandMethod
- Returns:
- the method
Parameters
.
-
getMethod
public Method getMethod()
- Specified by:
getMethod
in interfaceCommandMethod
- Returns:
- the
Method
.
-
getReturnType
public ResolvableType getReturnType()
- Specified by:
getReturnType
in interfaceCommandMethod
- Returns:
- declared
Method
returnTypeInformation
.
-
getActualReturnType
public ResolvableType getActualReturnType()
- Specified by:
getActualReturnType
in interfaceCommandMethod
- Returns:
- the actual
Method
returnTypeInformation
after unwrapping.
-
getAnnotation
public <A extends Annotation> A getAnnotation(Class<A> annotationClass)
Lookup a method annotation.- Specified by:
getAnnotation
in interfaceCommandMethod
- Parameters:
annotationClass
- the annotation class.- Returns:
- the annotation object or
null
if not found.
-
hasAnnotation
public boolean hasAnnotation(Class<? extends Annotation> annotationClass)
- Specified by:
hasAnnotation
in interfaceCommandMethod
- Parameters:
annotationClass
- the annotation class.- Returns:
true
if the method is annotated withannotationClass
.
-
getName
public String getName()
- Specified by:
getName
in interfaceCommandMethod
- Returns:
- the method name.
-
isFutureExecution
public boolean isFutureExecution()
- Specified by:
isFutureExecution
in interfaceCommandMethod
- Returns:
true
if the method uses asynchronous execution declaringFuture
as result type.
-
isReactiveExecution
public boolean isReactiveExecution()
- Specified by:
isReactiveExecution
in interfaceCommandMethod
- Returns:
true
if the method uses reactive execution declaringPublisher
as result type.
-
isBatchExecution
public boolean isBatchExecution()
- Specified by:
isBatchExecution
in interfaceCommandMethod
- Returns:
true
if the method defines aCommandBatching
argument.
-
-