Class Parameter
java.lang.Object
org.springframework.data.repository.query.Parameter
Class to abstract a single parameter of a query method. It is held in the context of a
Parameters
instance.- Author:
- Oliver Gierke, Mark Paluch, Jens Schauder
-
Constructor Summary
ModifierConstructorDescriptionprotected
Parameter
(MethodParameter parameter) Creates a newParameter
for the givenMethodParameter
. -
Method Summary
Modifier and TypeMethodDescriptionint
getIndex()
Returns the position index the parameter is bound to in the context of its surroundingParameters
.getName()
Returns the name of the parameter (throughParam
annotation).Returns the placeholder to be used for the parameter.Class<?>
getType()
Returns the type of theParameter
.boolean
Returns whether theParameter
is to be bound to a query.boolean
Returns whether the currentParameter
is the one used for dynamic projections.boolean
Returns whether the parameter is named explicitly, i.e. annotated withParam
.boolean
Returns whether the parameter is annotated withParam
.boolean
Returns whether the parameter is a special parameter.toString()
-
Constructor Details
-
Parameter
Creates a newParameter
for the givenMethodParameter
.- Parameters:
parameter
- must not be null.
-
-
Method Details
-
isSpecialParameter
public boolean isSpecialParameter()Returns whether the parameter is a special parameter.- Returns:
- See Also:
-
TYPES
-
isBindable
public boolean isBindable()Returns whether theParameter
is to be bound to a query.- Returns:
-
isDynamicProjectionParameter
public boolean isDynamicProjectionParameter()Returns whether the currentParameter
is the one used for dynamic projections.- Returns:
-
getPlaceholder
Returns the placeholder to be used for the parameter. Can either be a named one or positional.- Returns:
-
getIndex
public int getIndex()Returns the position index the parameter is bound to in the context of its surroundingParameters
.- Returns:
-
isNamedParameter
public boolean isNamedParameter()Returns whether the parameter is annotated withParam
.- Returns:
-
getName
Returns the name of the parameter (throughParam
annotation).- Returns:
-
getType
Returns the type of theParameter
.- Returns:
- the type
-
isExplicitlyNamed
public boolean isExplicitlyNamed()Returns whether the parameter is named explicitly, i.e. annotated withParam
.- Returns:
- Since:
- 1.11
-
toString
-