Package spoon.pattern.internal
Class ResultHolder.Single<T>
java.lang.Object
spoon.pattern.internal.ResultHolder<T>
spoon.pattern.internal.ResultHolder.Single<T>
- Type Parameters:
T
-
- Enclosing class:
- ResultHolder<T>
Container of single value of required type
-
Nested Class Summary
Nested classes/interfaces inherited from class spoon.pattern.internal.ResultHolder
ResultHolder.Multiple<T>, ResultHolder.Single<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
adds a result into this result holderboolean
void
mapEachResult(Function<T,T> consumer)
calls consumer.accept(value) once for each contained valueMethods inherited from class spoon.pattern.internal.ResultHolder
getRequiredClass
-
Constructor Details
-
Single
-
-
Method Details
-
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
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
-
getResult
-
mapEachResult
Description copied from class:ResultHolder
calls consumer.accept(value) once for each contained value- Specified by:
mapEachResult
in classResultHolder<T>
-
getResults
- Specified by:
getResults
in classResultHolder<T>
- Returns:
- List of actually stored results
-