public class OneKeeperPartialResultHolder<R> extends Object implements PartialResultHolder<R>
Constructor and Description |
---|
OneKeeperPartialResultHolder() |
Modifier and Type | Method and Description |
---|---|
void |
accept(R result)
Accepts the result.
|
void |
acceptIfNeeded(Supplier<R> supplier)
Accepts only if previous result has been taken before.
|
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)
acceptIfNeeded
in interface PartialResultConsumer<R>
public Optional<R> take()
PartialResultProvider
take
in interface PartialResultProvider<R>