public abstract class Parameters<S extends Parameters<S,T>,T extends Parameter> extends Object implements Streamable<T>
Modifier | Constructor and Description |
---|---|
protected |
Parameters(List<T> originals)
Creates a new
Parameters instance with the given Parameter s put into new context. |
|
Parameters(Method method)
Creates a new instance of
Parameters . |
Modifier and Type | Method and Description |
---|---|
protected abstract S |
createFrom(List<T> parameters) |
protected abstract T |
createParameter(MethodParameter parameter)
Creates a
Parameter instance for the given MethodParameter . |
T |
getBindableParameter(int bindableIndex)
Returns a bindable parameter with the given index.
|
S |
getBindableParameters()
Returns a
Parameters instance with effectively all special parameters removed. |
int |
getDynamicProjectionIndex()
Returns the index of the parameter that represents the dynamic projection type.
|
int |
getNumberOfParameters()
Returns the number of parameters.
|
int |
getPageableIndex()
|
T |
getParameter(int index)
Returns the parameter with the given index.
|
int |
getSortIndex()
|
boolean |
hasDynamicProjection()
Returns whether a parameter expressing a dynamic projection exists.
|
boolean |
hasPageableParameter()
Returns whether the method the
Parameters was created for contains a Pageable argument. |
boolean |
hasParameterAt(int position)
Returns whether we have a parameter at the given position.
|
boolean |
hasSortParameter()
Returns whether the method the
Parameters was created for contains a Sort argument. |
boolean |
hasSpecialParameter()
|
static boolean |
isBindable(Class<?> type)
Returns whether the given type is a bindable parameter.
|
Iterator<T> |
iterator() |
boolean |
potentiallySortsDynamically()
Returns whether we potentially find a
Sort parameter in the parameters. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
and, and, and, and, empty, filter, flatMap, get, isEmpty, map, of, of, of, stream, toList, toSet, toStreamable, toStreamable
forEach, spliterator
public Parameters(Method method)
Parameters
.method
- must not be null.protected Parameters(List<T> originals)
Parameters
instance with the given Parameter
s put into new context.originals
- protected abstract T createParameter(MethodParameter parameter)
Parameter
instance for the given MethodParameter
.parameter
- will never be null.public boolean hasPageableParameter()
Parameters
was created for contains a Pageable
argument.public int getPageableIndex()
Pageable
Method
parameter if available. Will return -1 if there
is no Pageable
argument in the Method
's parameter list.public int getSortIndex()
Sort
Method
parameter if available. Will return -1 if there is
no Sort
argument in the Method
's parameter list.public boolean hasSortParameter()
Parameters
was created for contains a Sort
argument.public int getDynamicProjectionIndex()
public boolean hasDynamicProjection()
public boolean potentiallySortsDynamically()
Sort
parameter in the parameters.public T getParameter(int index)
index
- public boolean hasParameterAt(int position)
position
- public boolean hasSpecialParameter()
public int getNumberOfParameters()
public S getBindableParameters()
Parameters
instance with effectively all special parameters removed.Parameter.TYPES
,
Parameter.isSpecialParameter()
public T getBindableParameter(int bindableIndex)
(Pageable pageable, String name)
a call to #getBindableParameter(0)
will return the String
parameter.bindableIndex
- public static boolean isBindable(Class<?> type)
type
- Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.