R - result typepublic interface PartialResultConsumer<R>
| Modifier and Type | Method and Description |
|---|---|
default void |
accept(R result)
Accepts the result.
|
void |
acceptIfNeeded(Supplier<R> resultMethod)
Optionally accepts a partial result.
|
static <T> PartialResultConsumer<T> |
nullConsumer() |
default <T> PartialResultConsumer<T> |
transform(Function<T,R> function)
Decorates this
PartialResultConsumer with a type conversion. |
default void accept(R result)
t - void acceptIfNeeded(Supplier<R> resultMethod)
Supplier.get() only invoked on the caller thread; before returning from this methoddefault <T> PartialResultConsumer<T> transform(Function<T,R> function)
PartialResultConsumer with a type conversion.T - the type to transformPartialResultConsumer of the transformed type.static <T> PartialResultConsumer<T> nullConsumer()