public class NumberIterableResultAdapter extends AbstractIterableResultAdapter<Object>
This class will adapt results from an iterable object to a number. The future task returned will have already executed with the results available.
It will accept adaptations wherein the original value is some sort of iterable and the required return type
is an instance of Number. Additionally, it will check to see if the iterable yields only one item and
also that the item is a number.
Here is a list of supported number types:
This adapter will execute at priority -425.
| Constructor and Description |
|---|
NumberIterableResultAdapter() |
| 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, getPriorityprotected 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 typepublic boolean accepts(Invocation invocation, Object originalValue)
ResultAdapterinvocation - the invocationoriginalValue - the original valueCopyright © 2014–2016. All rights reserved.