Package spoon.pattern.internal
Class ResultHolder.Multiple<T>
- java.lang.Object
-
- spoon.pattern.internal.ResultHolder<T>
-
- spoon.pattern.internal.ResultHolder.Multiple<T>
-
- Type Parameters:
T
-
- Enclosing class:
- ResultHolder<T>
public static class ResultHolder.Multiple<T> extends ResultHolder<T>
Container of multiple values of required type
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class spoon.pattern.internal.ResultHolder
ResultHolder.Multiple<T>, ResultHolder.Single<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResult(T value)
adds a result into this result holderList<T>
getResult()
List<T>
getResults()
boolean
isMultiple()
void
mapEachResult(Function<T,T> consumer)
calls consumer.accept(value) once for each contained value-
Methods inherited from class spoon.pattern.internal.ResultHolder
getRequiredClass
-
-
-
-
Method Detail
-
isMultiple
public boolean isMultiple()
- Specified by:
isMultiple
in classResultHolder<T>
- Returns:
- true if it accepts 0, 1 or more values. false if it accepts exactly one value. If none, then value is null
-
addResult
public void addResult(T value)
Description copied from class:ResultHolder
adds a result into this result holder- Specified by:
addResult
in classResultHolder<T>
- Parameters:
value
- a new value of result holder
-
getResults
public List<T> getResults()
- Specified by:
getResults
in classResultHolder<T>
- Returns:
- List of actually stored results
-
mapEachResult
public void mapEachResult(Function<T,T> consumer)
Description copied from class:ResultHolder
calls consumer.accept(value) once for each contained value- Specified by:
mapEachResult
in classResultHolder<T>
-
-