public class SimplePartialResultHolder<R> extends Object implements PartialResultHolder<R>
| Constructor and Description |
|---|
SimplePartialResultHolder() |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(R result)
Accepts the result.
|
void |
acceptIfNeeded(Supplier<R> supplier)
Optionally accepts a partial result.
|
Optional<R> |
take()
Takes partial result if exists.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnullInstancenullConsumer, transformpublic void accept(R result)
PartialResultConsumeraccept in interface PartialResultConsumer<R>public void acceptIfNeeded(Supplier<R> supplier)
PartialResultConsumerSupplier.get() only invoked on the caller thread; before returning from this methodacceptIfNeeded in interface PartialResultConsumer<R>public Optional<R> take()
PartialResultProvidertake in interface PartialResultProvider<R>