Class Parameter
- java.lang.Object
-
- io.lettuce.core.dynamic.parameter.Parameter
-
- Direct Known Subclasses:
ExecutionSpecificParameters.ExecutionAwareParameter
public class Parameter extends Object
Abstracts a method parameter and exposes access to type and parameter information.- Since:
- 5.0
- Author:
- Mark Paluch
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A extends Annotation>
AfindAnnotation(Class<A> annotationType)
Return the parameter annotation of the given type, if available.List<? extends Annotation>
getAnnotations()
Return all parameter annotations.String
getName()
int
getParameterIndex()
Class<?>
getParameterType()
TypeInformation<?>
getTypeInformation()
boolean
isAssignableTo(Class<?> target)
Check whether the parameter is assignable totarget
.boolean
isSpecialParameter()
-
-
-
Constructor Detail
-
Parameter
public Parameter(Method method, int parameterIndex)
-
-
Method Detail
-
findAnnotation
public <A extends Annotation> A findAnnotation(Class<A> annotationType)
Return the parameter annotation of the given type, if available.- Parameters:
annotationType
- the annotation type to look for- Returns:
- the annotation object, or
null
if not found
-
getAnnotations
public List<? extends Annotation> getAnnotations()
Return all parameter annotations.- Returns:
- the
List
of annotation objects.
-
getParameterIndex
public int getParameterIndex()
- Returns:
- the parameter index.
-
getParameterType
public Class<?> getParameterType()
- Returns:
- the parameter type.
-
getTypeInformation
public TypeInformation<?> getTypeInformation()
- Returns:
- the parameter
TypeInformation
.
-
isAssignableTo
public boolean isAssignableTo(Class<?> target)
Check whether the parameter is assignable totarget
.- Parameters:
target
- must not benull
.- Returns:
-
isSpecialParameter
public boolean isSpecialParameter()
- Returns:
true
if the parameter is a special parameter.
-
getName
public String getName()
- Returns:
- the parameter name or
null
if not available.
-
-