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
ConstructorDescriptionParametersParameterAccessor
(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 thePageable
of the parameters, if available.Parameters<?,
?> Returns theParameters
instance backing the accessor.Returns theScrollPosition
of the parameters, if available.getSort()
Returns the sort instance to be used for query creation.protected <T> T
getValue
(int index) Returns the value with the given index.protected Object[]
Returns the potentially unwrapped values.boolean
Returns whether one of the bindable parameter values is null.org.springframework.data.repository.query.ParametersParameterAccessor.BindableParameterIterator
iterator()
Returns an iterator over all bindable parameters.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 theParameters
instance backing the accessor.- Returns:
- the parameters will never be null.
-
getValues
Returns the potentially unwrapped values.- Returns:
-
getScrollPosition
Description copied from interface:ParameterAccessor
Returns theScrollPosition
of the parameters, if available. Returnsnull
otherwise.- Specified by:
getScrollPosition
in interfaceParameterAccessor
- Returns:
-
getPageable
Description copied from interface:ParameterAccessor
Returns thePageable
of the parameters, if available. ReturnsPageable.unpaged()
otherwise.- Specified by:
getPageable
in interfaceParameterAccessor
- Returns:
-
getSort
Description copied from interface:ParameterAccessor
Returns the sort instance to be used for query creation. Will use aSort
parameter if available or theSort
contained in aPageable
if available. ReturnsSort.unsorted()
if noSort
can be found.- Specified by:
getSort
in interfaceParameterAccessor
- Returns:
-
findDynamicProjection
Returns the dynamic projection type if available, null otherwise.- Specified by:
findDynamicProjection
in interfaceParameterAccessor
- Returns:
-
getValue
Returns the value with the given index.- Parameters:
index
-- Returns:
-
getBindableValue
Description copied from interface:ParameterAccessor
Returns the bindable value with the given index. Bindable means, thatPageable
andSort
values are skipped without noticed in the index. For a method signature takingString
,Pageable
,String
,#getBindableParameter(1)
would return the secondString
value.- Specified by:
getBindableValue
in interfaceParameterAccessor
- Returns:
-
hasBindableNullValue
public boolean hasBindableNullValue()Description copied from interface:ParameterAccessor
Returns whether one of the bindable parameter values is null.- Specified by:
hasBindableNullValue
in interfaceParameterAccessor
- Returns:
-
iterator
public org.springframework.data.repository.query.ParametersParameterAccessor.BindableParameterIterator iterator()Description copied from interface:ParameterAccessor
Returns an iterator over all bindable parameters. This means parameters implementingPageable
orSort
will not be included in thisIterator
.- Specified by:
iterator
in interfaceIterable<Object>
- Specified by:
iterator
in interfaceParameterAccessor
-