Package spoon.pattern.internal
Class ResultHolder<T>
java.lang.Object
spoon.pattern.internal.ResultHolder<T>
- Direct Known Subclasses:
ResultHolder.Multiple
,ResultHolder.Single
Container for single or multiple values of required type
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Container of multiple values of required typestatic class
Container of single value of required type -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
adds a result into this result holderabstract boolean
abstract void
mapEachResult(Function<T,T> consumer)
calls consumer.accept(value) once for each contained value
-
Constructor Details
-
ResultHolder
-
-
Method Details
-
getRequiredClass
- Returns:
- the class of values, which acceptable by this result holder
-
isMultiple
public abstract boolean isMultiple()- Returns:
- true if it accepts 0, 1 or more values. false if it accepts exactly one value. If none, then value is null
-
addResult
adds a result into this result holder- Parameters:
value
- a new value of result holder
-
mapEachResult
calls consumer.accept(value) once for each contained value- Parameters:
consumer
-
-
getResults
- Returns:
- List of actually stored results
-