public class ParametersParameterAccessor extends Object implements ParameterAccessor
ParameterAccessor
implementation using a Parameters
instance to find special parameters.Constructor and Description |
---|
ParametersParameterAccessor(Parameters<?,?> parameters,
Object[] values)
Creates a new
ParametersParameterAccessor . |
Modifier and Type | Method and Description |
---|---|
Class<?> |
findDynamicProjection()
Returns the dynamic projection type if available, null otherwise.
|
Object |
getBindableValue(int index)
Returns the bindable value with the given index.
|
Optional<Class<?>> |
getDynamicProjection()
Returns the dynamic projection type if available, null otherwise.
|
Pageable |
getPageable()
Returns the
Pageable of the parameters, if available. |
Parameters<?,?> |
getParameters()
Returns the
Parameters instance backing the accessor. |
Sort |
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[] |
getValues()
Returns the potentially unwrapped values.
|
boolean |
hasBindableNullValue()
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ParametersParameterAccessor(Parameters<?,?> parameters, Object[] values)
ParametersParameterAccessor
.parameters
- must not be null.values
- must not be null.public Parameters<?,?> getParameters()
Parameters
instance backing the accessor.protected Object[] getValues()
public Pageable getPageable()
ParameterAccessor
Pageable
of the parameters, if available. Returns null
otherwise.getPageable
in interface ParameterAccessor
public Sort getSort()
ParameterAccessor
Sort
parameter if available or the
Sort
contained in a Pageable
if available. Returns null
if no Sort
can be found.getSort
in interface ParameterAccessor
public Optional<Class<?>> getDynamicProjection()
getDynamicProjection
in interface ParameterAccessor
@Nullable public Class<?> findDynamicProjection()
findDynamicProjection
in interface ParameterAccessor
protected <T> T getValue(int index)
index
- public Object getBindableValue(int index)
ParameterAccessor
Pageable
and Sort
values are
skipped without noticed in the index. For a method signature taking String
, Pageable
,
String
, #getBindableParameter(1)
would return the second String
value.getBindableValue
in interface ParameterAccessor
public boolean hasBindableNullValue()
ParameterAccessor
hasBindableNullValue
in interface ParameterAccessor
public org.springframework.data.repository.query.ParametersParameterAccessor.BindableParameterIterator iterator()
ParameterAccessor
Pageable
or
Sort
will not be included in this Iterator
.iterator
in interface Iterable<Object>
iterator
in interface ParameterAccessor
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.