@Mutable @Functional public interface Producer<OUTPUT> extends FailableProducer<OUTPUT,RuntimeException>
OUTPUT without requiring a parameter.| Modifier and Type | Method and Description |
|---|---|
default @Nonnull UnaryFunction<Object,OUTPUT> |
asFunction()
Returns this producer as a unary function that ignores its input.
|
default <FINAL_OUTPUT> |
before(@Nonnull UnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT> function)
Returns the composition of this producer followed by the given function.
|
static <OUTPUT> @Nonnull Producer<OUTPUT> |
constant(OUTPUT output)
Returns a producer that always produces the given output.
|
default @Nonnull Producer<OUTPUT> |
memoize(long duration)
Returns a producer that caches each object produced by this producer for the given duration in milliseconds.
|
default @Nonnull Producer<OUTPUT> |
synchronize()
Returns a producer that synchronizes on this producer.
|
before, compose, produce, suppressExceptions, suppressExceptions, suppressExceptions, suppressExceptions@Pure @Nonnull default <FINAL_OUTPUT> @Nonnull Producer<FINAL_OUTPUT> before(@Nonnull @Nonnull UnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT> function)
@Pure @Nonnull default @Nonnull UnaryFunction<Object,OUTPUT> asFunction()
FailableProducerasFunction in interface FailableProducer<OUTPUT,RuntimeException>@Pure @Nonnull default @Nonnull Producer<OUTPUT> synchronize()
FailableProducersynchronize in interface FailableProducer<OUTPUT,RuntimeException>@Pure @Nonnull default @Nonnull Producer<OUTPUT> memoize(long duration)
FailableProducermemoize in interface FailableProducer<OUTPUT,RuntimeException>Copyright © 2017. All rights reserved.