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, wait
nullInstance
nullConsumer, transform
public void accept(R result)
PartialResultConsumer
accept
in interface PartialResultConsumer<R>
public void acceptIfNeeded(Supplier<R> supplier)
PartialResultConsumer
Supplier.get()
only invoked on the caller thread; before returning from this methodacceptIfNeeded
in interface PartialResultConsumer<R>
public Optional<R> take()
PartialResultProvider
take
in interface PartialResultProvider<R>