public class OptionalResultAdapter extends AbstractIterableResultAdapter<Object>
Iterable object and
the requested method type is an Optional value.
While adapting, the adapter will also check that the iterable yields only one item and that it is of the same type or of a child type of the type requested by the invoked method.
This adapter runs at the priority -400.
| Constructor and Description |
|---|
OptionalResultAdapter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accepts(Invocation invocation,
Object originalValue)
Called to determine whether or not this adapter can adapt the original value passed down from a
data store operation to the type required by the repository method being invoked
|
protected Object |
doAdapt(Invocation invocation,
Iterable iterable)
This is called when we want to adapt an iterable object to another type.
|
adaptcompareTo, getPrioritypublic boolean accepts(Invocation invocation, Object originalValue)
ResultAdapterinvocation - the invocationoriginalValue - the original valueprotected Object doAdapt(Invocation invocation, Iterable iterable)
AbstractIterableResultAdapterdoAdapt in class AbstractIterableResultAdapter<Object>invocation - the invocation which called for this adaptationiterable - the iterable to be adapted to the appropriate result typeCopyright © 2014–2021. All rights reserved.