Class ParametersParameterAccessor
java.lang.Object
org.springframework.data.repository.query.ParametersParameterAccessor
- All Implemented Interfaces:
Iterable<Object>, ParameterAccessor
ParameterAccessor implementation using a Parameters instance to find special parameters.- Author:
- Oliver Gierke, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionParametersParameterAccessor(Parameters<?, ?> parameters, @Nullable Object[] values) Creates a newParametersParameterAccessor. -
Method Summary
Modifier and TypeMethodDescription@Nullable Class<?> Returns the dynamic projection type if available, null otherwise.@Nullable ObjectgetBindableValue(int index) Returns the bindable value with the given index.getLimit()Parameters<?, ?> Returns theParametersinstance backing the accessor.@Nullable ScoregetScore()@Nullable ScrollPositiongetSort()protected <T> @Nullable TgetValue(int index) Returns the value with the given index.protected @Nullable Object[]Returns the potentially unwrapped values.@Nullable VectorbooleanReturns whether one of the bindable parameter values is null.iterator()Returns an iterator over all bindable parameters.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
ParametersParameterAccessor
Creates a newParametersParameterAccessor.- Parameters:
parameters- must not be null.values- must not be null.
-
-
Method Details
-
getParameters
Returns theParametersinstance backing the accessor.- Returns:
- the parameters will never be null.
-
getValues
-
getVector
- Specified by:
getVectorin interfaceParameterAccessor- Returns:
- the
Vectorof the parameters, if available; null otherwise.
-
getScore
- Specified by:
getScorein interfaceParameterAccessor- Returns:
- the
Scoreof the parameters, if available; null otherwise.
-
getScoreRange
- Specified by:
getScoreRangein interfaceParameterAccessor- Returns:
- the
RangeofScoreof the parameters, if available; null otherwise.
-
getScrollPosition
- Specified by:
getScrollPositionin interfaceParameterAccessor- Returns:
- the
ScrollPositionof the parameters, if available; null otherwise.
-
getPageable
- Specified by:
getPageablein interfaceParameterAccessor- Returns:
- the
Pageableof the parameters, if available;Pageable.unpaged()otherwise.
-
getSort
- Specified by:
getSortin interfaceParameterAccessor- Returns:
- the sort instance to be used for query creation. Will use a
Sortparameter if available or theSortcontained in aPageableif available.Sort.unsorted()if noSortcan be found.
-
getLimit
- Specified by:
getLimitin interfaceParameterAccessor- Returns:
- the
Limitinstance to be used for query creation. If noParameterassignable toLimitcan be foundLimitwill be created out ofPageable.getPageSize()if present.
-
findDynamicProjection
Returns the dynamic projection type if available, null otherwise.- Specified by:
findDynamicProjectionin interfaceParameterAccessor- Returns:
-
getValue
protected <T> @Nullable T getValue(int index) Returns the value with the given index.- Parameters:
index-- Returns:
-
getBindableValue
Description copied from interface:ParameterAccessorReturns the bindable value with the given index. Bindable means, thatPageableandSortvalues are skipped without noticed in the index. For a method signature takingString,Pageable,String,#getBindableParameter(1)would return the secondStringvalue.- Specified by:
getBindableValuein interfaceParameterAccessor- Parameters:
index-- Returns:
- the bindable value with the given index
-
hasBindableNullValue
public boolean hasBindableNullValue()Description copied from interface:ParameterAccessorReturns whether one of the bindable parameter values is null.- Specified by:
hasBindableNullValuein interfaceParameterAccessor- Returns:
- true if one of the bindable parameter values is null.
-
iterator
Description copied from interface:ParameterAccessorReturns an iterator over all bindable parameters. This means parameters implementingPageableorSortwill not be included in thisIterator.- Specified by:
iteratorin interfaceIterable<Object>- Specified by:
iteratorin interfaceParameterAccessor- Returns:
- iterator over all bindable parameters.
-