Class Parameters<S extends Parameters<S,T>,T extends Parameter>  
java.lang.Object
org.springframework.data.repository.query.Parameters<S,T> 
- All Implemented Interfaces:
- Iterable<T>,- Supplier<Stream<T>>,- Streamable<T>
- Direct Known Subclasses:
- DefaultParameters
public abstract class Parameters<S extends Parameters<S,T>,T extends Parameter>  
extends Object
implements Streamable<T>
Abstracts method parameters that have to be bound to query parameters or applied to the query independently.
- Author:
- Oliver Gierke, Christoph Strobl, Johannes Englmeier
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedParameters(Method method, Function<MethodParameter, T> parameterFactory) Deprecated, for removal: This API element is subject to removal in a future version.protectedParameters(List<T> originals) Creates a newParametersinstance with the givenParameters put into new context.protectedParameters(ParametersSource parametersSource, Function<MethodParameter, T> parameterFactory) Creates a newParametersinstance for the givenMethodandFunctionto create aParameterinstance from aMethodParameter.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract ScreateFrom(List<T> parameters) getBindableParameter(int bindableIndex) Returns a bindable parameter with the given index.Returns aParametersinstance with effectively all special parameters removed.intReturns the index of the parameter that represents the dynamic projection type.intintReturns the number of parameters.intgetParameter(int index) Returns the parameter with the given index.intReturns the index of theScrollPositionMethodparameter if available.intbooleanReturns whether a parameter expressing a dynamic projection exists.booleanReturns whether the method theParameterswas created for contains aLimitargument.booleanReturns whether the method theParameterswas created for contains aPageableargument.booleanhasParameterAt(int position) Returns whether we have a parameter at the given position.booleanReturns whether the method theParameterswas created for contains aScrollPositionargument.booleanReturns whether the method theParameterswas created for contains aSortargument.booleanstatic booleanisBindable(Class<?> type) Returns whether the given type is a bindable parameter.iterator()booleanReturns whether we potentially find aSortparameter in the parameters.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
TYPES
 
- 
- 
Constructor Details- 
Parameters@Deprecated(since="3.2.1", forRemoval=true) protected Parameters(Method method, Function<MethodParameter, T> parameterFactory) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newParametersinstance for the givenMethodandFunctionto create aParameterinstance from aMethodParameter.- Parameters:
- method- must not be null.
- parameterFactory- must not be null.
- Since:
- 3.0.2
 
- 
Parametersprotected Parameters(ParametersSource parametersSource, Function<MethodParameter, T> parameterFactory) Creates a newParametersinstance for the givenMethodandFunctionto create aParameterinstance from aMethodParameter.- Parameters:
- parametersSource- must not be null.
- parameterFactory- must not be null.
- Since:
- 3.2.1
 
- 
ParametersCreates a newParametersinstance with the givenParameters put into new context.- Parameters:
- originals-
 
 
- 
- 
Method Details- 
hasScrollPositionParameterpublic boolean hasScrollPositionParameter()Returns whether the method theParameterswas created for contains aScrollPositionargument.- Returns:
- Since:
- 3.1
 
- 
getScrollPositionIndexpublic int getScrollPositionIndex()Returns the index of theScrollPositionMethodparameter if available. Will return -1 if there is noScrollPositionargument in theMethod's parameter list.- Returns:
- the scrollPositionIndex
- Since:
- 3.1
 
- 
hasPageableParameterpublic boolean hasPageableParameter()Returns whether the method theParameterswas created for contains aPageableargument.- Returns:
 
- 
getPageableIndexpublic int getPageableIndex()Returns the index of thePageableMethodparameter if available. Will return -1 if there is noPageableargument in theMethod's parameter list.- Returns:
- the pageableIndex
 
- 
getSortIndexpublic int getSortIndex()Returns the index of theSortMethodparameter if available. Will return -1 if there is noSortargument in theMethod's parameter list.- Returns:
 
- 
hasSortParameterpublic boolean hasSortParameter()Returns whether the method theParameterswas created for contains aSortargument.- Returns:
 
- 
hasLimitParameterpublic boolean hasLimitParameter()Returns whether the method theParameterswas created for contains aLimitargument.- Returns:
- Since:
- 3.2
 
- 
getLimitIndexpublic int getLimitIndex()Returns the index of theLimitMethodparameter if available. Will return -1 if there is noLimitargument in theMethod's parameter list.- Returns:
- Since:
- 3.2
 
- 
getDynamicProjectionIndexpublic int getDynamicProjectionIndex()Returns the index of the parameter that represents the dynamic projection type. Will return -1 if no such parameter exists.- Returns:
 
- 
hasDynamicProjectionpublic boolean hasDynamicProjection()Returns whether a parameter expressing a dynamic projection exists.- Returns:
 
- 
potentiallySortsDynamicallypublic boolean potentiallySortsDynamically()Returns whether we potentially find aSortparameter in the parameters.- Returns:
 
- 
getParameterReturns the parameter with the given index.- Parameters:
- index-
- Returns:
 
- 
hasParameterAtpublic boolean hasParameterAt(int position) Returns whether we have a parameter at the given position.- Parameters:
- position-
- Returns:
 
- 
hasSpecialParameterpublic boolean hasSpecialParameter()- Returns:
 
- 
getNumberOfParameterspublic int getNumberOfParameters()Returns the number of parameters.- Returns:
 
- 
getBindableParametersReturns aParametersinstance with effectively all special parameters removed.- Returns:
- See Also:
- 
- Parameter.TYPES
- Parameter.isSpecialParameter()
 
 
- 
createFrom
- 
getBindableParameterReturns a bindable parameter with the given index. So for a method with a signature of(Pageable pageable, String name)a call to#getBindableParameter(0)will return theStringparameter.- Parameters:
- bindableIndex-
- Returns:
 
- 
isBindableReturns whether the given type is a bindable parameter.- Parameters:
- type-
- Returns:
 
- 
iterator
 
- 
Parameters(org.springframework.data.repository.query.ParametersSource,java.util.function.Function<org.springframework.core.MethodParameter,T>)instead.