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, Object[] values) Creates a newParametersParameterAccessor. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>Returns the dynamic projection type if available, null otherwise.getBindableValue(int index) Returns the bindable value with the given index.Returns thePageableof the parameters, if available.Parameters<?,?> Returns theParametersinstance backing the accessor.getSort()Returns the sort instance to be used for query creation.protected <T> TgetValue(int index) Returns the value with the given index.protected Object[]Returns the potentially unwrapped values.booleanReturns whether one of the bindable parameter values is null.org.springframework.data.repository.query.ParametersParameterAccessor.BindableParameterIteratoriterator()Returns an iterator over all bindable parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.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
Returns the potentially unwrapped values.- Returns:
-
getPageable
Description copied from interface:ParameterAccessorReturns thePageableof the parameters, if available. ReturnsPageable.unpaged()otherwise.- Specified by:
getPageablein interfaceParameterAccessor- Returns:
-
getSort
Description copied from interface:ParameterAccessorReturns the sort instance to be used for query creation. Will use aSortparameter if available or theSortcontained in aPageableif available. ReturnsSort.unsorted()if noSortcan be found.- Specified by:
getSortin interfaceParameterAccessor- Returns:
-
findDynamicProjection
Returns the dynamic projection type if available, null otherwise.- Specified by:
findDynamicProjectionin interfaceParameterAccessor- Returns:
-
getValue
@Nullable protected <T> 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- Returns:
-
hasBindableNullValue
public boolean hasBindableNullValue()Description copied from interface:ParameterAccessorReturns whether one of the bindable parameter values is null.- Specified by:
hasBindableNullValuein interfaceParameterAccessor- Returns:
-
iterator
public org.springframework.data.repository.query.ParametersParameterAccessor.BindableParameterIterator 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
-