public class LoaderBuilderCompat extends Object
Created by davide-maestroni on 03/06/2016.
| Modifier and Type | Method and Description |
|---|---|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(Class<? extends Invocation<IN,OUT>> invocationClass)
Returns a routine builder based on an invocation factory creating instances of the specified
class.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(Class<? extends Invocation<IN,OUT>> invocationClass,
Object... args)
Returns a routine builder based on an invocation factory creating instances of the specified
class by passing the specified arguments to the class constructor.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(ClassToken<? extends Invocation<IN,OUT>> invocationToken)
Returns a routine builder based on an invocation factory creating instances of the specified
class token.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(ClassToken<? extends Invocation<IN,OUT>> invocationToken,
Object... args)
Returns a routine builder based on an invocation factory creating instances of the specified
class token by passing the specified arguments to the class constructor.
|
<OUT> LoaderRoutineBuilder<Void,OUT> |
with(CommandInvocation<OUT> invocation)
Returns a routine builder based on the specified command invocation.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(ContextInvocationFactory<IN,OUT> factory)
Returns a builder of routines bound to the builder context.
|
LoaderObjectProxyRoutineBuilder |
with(ContextInvocationTarget<?> target)
Returns a builder of routines bound to the builder context, wrapping the specified target
object.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(Invocation<IN,OUT> invocation)
Returns a routine builder based on an invocation factory creating instances of the specified
object.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(Invocation<IN,OUT> invocation,
Object... args)
Returns a routine builder based on an invocation factory creating instances of the specified
object.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(InvocationFactory<IN,OUT> factory)
Returns a builder of routines bound to the builder context.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
with(MappingInvocation<IN,OUT> invocation)
Returns a routine builder based on the specified mapping invocation.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
withCall(Function<? super List<IN>,? extends OUT> function)
Returns a routine builder based on a call invocation factory backed by the specified function.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
withCallConsumer(BiConsumer<? super List<IN>,? super Channel<OUT,?>> consumer)
Returns a routine builder based on a call invocation factory backed by the specified consumer.
|
LoaderObjectProxyRoutineBuilder |
withClassOfType(Class<?> targetClass)
Returns a builder of routines bound to the builder context, wrapping the specified target
class.
|
<OUT> LoaderRoutineBuilder<Void,OUT> |
withCommand(Supplier<? extends OUT> supplier)
Returns a routine builder based on a command invocation backed by the specified supplier.
|
<OUT> LoaderRoutineBuilder<Void,OUT> |
withCommandConsumer(Consumer<? super Channel<OUT,?>> consumer)
Returns a routine builder based on a command invocation backed by the specified consumer.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
withContextFactory(Supplier<? extends ContextInvocation<? super IN,? extends OUT>> supplier)
Returns a routine builder based on an invocation factory backed by the specified supplier.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
withFactory(Supplier<? extends Invocation<? super IN,? extends OUT>> supplier)
Returns a routine builder based on an invocation factory backed by the specified supplier.
|
<IN> LoaderRoutineBuilder<IN,IN> |
withFilter(Predicate<? super IN> predicate)
Returns a routine builder based on a operation invocation backed by the specified predicate.
|
LoaderChannelBuilder |
withId(int loaderId)
Returns a builder of channels bound to the Loader identified by the specified ID.
|
LoaderObjectProxyRoutineBuilder |
withInstanceOf(Class<?> targetClass)
Returns a builder of routines bound to the builder context, wrapping the specified target
object.
|
LoaderObjectProxyRoutineBuilder |
withInstanceOf(Class<?> targetClass,
Object... factoryArgs)
Returns a builder of routines bound to the builder context, wrapping the specified target
object.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
withMapping(Function<? super IN,? extends OUT> function)
Returns a routine builder based on a mapping invocation backed by the specified function.
|
<IN,OUT> LoaderRoutineBuilder<IN,OUT> |
withMappingConsumer(BiConsumer<? super IN,? super Channel<OUT,?>> consumer)
Returns a routine builder based on a mapping invocation backed by the specified consumer.
|
@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull Class<? extends Invocation<IN,OUT>> invocationClass)
ContextInvocation.
Note that inner and anonymous classes can be passed as well. Remember however that Java creates synthetic constructors for such classes, so be sure to specify the correct arguments to guarantee proper instantiation.
IN - the input data type.OUT - the output data type.invocationClass - the invocation class.IllegalArgumentException - if the class of the specified invocation has not a
static scope or no default construct is found.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull Class<? extends Invocation<IN,OUT>> invocationClass, @Nullable Object... args)
ContextInvocation.
Note that inner and anonymous classes can be passed as well. Remember however that Java creates synthetic constructors for such classes, so be sure to specify the correct arguments to guarantee proper instantiation.
IN - the input data type.OUT - the output data type.invocationClass - the invocation class.args - the invocation constructor arguments.IllegalArgumentException - if the class of the specified invocation has not a
static scope or no construct constructor taking
the specified objects as parameters is found.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull ClassToken<? extends Invocation<IN,OUT>> invocationToken)
ContextInvocation.
Note that inner and anonymous classes can be passed as well. Remember however that Java creates synthetic constructors for such classes, so be sure to specify the correct arguments to guarantee proper instantiation.
IN - the input data type.OUT - the output data type.invocationToken - the invocation class token.IllegalArgumentException - if the class of the specified invocation has not a
static scope or no default construct is found.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull ClassToken<? extends Invocation<IN,OUT>> invocationToken, @Nullable Object... args)
ContextInvocation.
Note that inner and anonymous classes can be passed as well. Remember however that Java creates synthetic constructors for such classes, so be sure to specify the correct arguments to guarantee proper instantiation.
IN - the input data type.OUT - the output data type.invocationToken - the invocation class token.args - the invocation constructor arguments.IllegalArgumentException - if the class of the specified invocation has not a
static scope or no construct constructor taking
the specified objects as parameters is found.@NotNull public <OUT> LoaderRoutineBuilder<Void,OUT> with(@NotNull CommandInvocation<OUT> invocation)
OUT - the output data type.invocation - the command invocation instance.IllegalArgumentException - if the class of the specified invocation has not a
static scope.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull MappingInvocation<IN,OUT> invocation)
IN - the input data type.OUT - the output data type.invocation - the mapping invocation instance.IllegalArgumentException - if the class of the specified invocation has not a
static scope.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull Invocation<IN,OUT> invocation)
ContextInvocation.
Note that inner and anonymous objects can be passed as well. Remember however that Java creates synthetic constructors for such classes, so be sure to specify the correct arguments to guarantee proper instantiation.
IN - the input data type.OUT - the output data type.invocation - the invocation instance.IllegalArgumentException - if the class of the specified invocation has not a
static scope or no default construct is found.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull Invocation<IN,OUT> invocation, @Nullable Object... args)
ContextInvocation.
Note that inner and anonymous objects can be passed as well. Remember however that Java creates synthetic constructors for such classes, so be sure to specify the correct arguments to guarantee proper instantiation.
IN - the input data type.OUT - the output data type.invocation - the invocation instance.args - the invocation constructor arguments.IllegalArgumentException - if the class of the specified invocation has not a
static scope or no default construct is found.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull ContextInvocationFactory<IN,OUT> factory)
Note that the built routine results will be always dispatched on the configured Looper thread,
thus waiting for the outputs immediately after its invocation may result in a deadlock.
Note also that the input data passed to the invocation channel will be cached, and the
results will be produced only after the invocation channel is closed, so be sure to avoid
streaming inputs in order to prevent starvation or out of memory errors.
IN - the input data type.OUT - the output data type.factory - the invocation factory.IllegalArgumentException - if the class of the specified factory has not a
static scope.@NotNull public LoaderObjectProxyRoutineBuilder with(@NotNull ContextInvocationTarget<?> target)
FactoryContext as the
application Context.
Note that the built routine results will be always dispatched on the configured Looper thread, thus waiting for the outputs immediately after its invocation may result in a deadlock.
target - the invocation target.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> with(@NotNull InvocationFactory<IN,OUT> factory)
Note that the built routine results will be always dispatched on the configured Looper thread,
thus waiting for the outputs immediately after its invocation may result in a deadlock.
Note also that the input data passed to the invocation channel will be cached, and the
results will be produced only after the invocation channel is closed, so be sure to avoid
streaming inputs in order to prevent starvation or out of memory errors.
IN - the input data type.OUT - the output data type.factory - the invocation factory.IllegalArgumentException - if the class of the specified factory has not a
static scope.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> withCall(@NotNull Function<? super List<IN>,? extends OUT> function)
IN - the input data type.OUT - the output data type.function - the function instance.IllegalArgumentException - if the class of the specified consumer has not a
static scope.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> withCallConsumer(@NotNull BiConsumer<? super List<IN>,? super Channel<OUT,?>> consumer)
IN - the input data type.OUT - the output data type.consumer - the consumer instance.IllegalArgumentException - if the class of the specified consumer has not a
static scope.@NotNull public LoaderObjectProxyRoutineBuilder withClassOfType(@NotNull Class<?> targetClass)
FactoryContext as the
application Context.
Note that the built routine results will be always dispatched on the configured Looper thread, thus waiting for the outputs immediately after its invocation may result in a deadlock.
targetClass - the invocation target class.@NotNull public <OUT> LoaderRoutineBuilder<Void,OUT> withCommand(@NotNull Supplier<? extends OUT> supplier)
OUT - the output data type.supplier - the supplier instance.IllegalArgumentException - if the class of the specified supplier has not a
static scope.@NotNull public <OUT> LoaderRoutineBuilder<Void,OUT> withCommandConsumer(@NotNull Consumer<? super Channel<OUT,?>> consumer)
OUT - the output data type.consumer - the consumer instance.IllegalArgumentException - if the class of the specified consumer has not a
static scope.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> withContextFactory(@NotNull Supplier<? extends ContextInvocation<? super IN,? extends OUT>> supplier)
IN - the input data type.OUT - the output data type.supplier - the supplier instance.IllegalArgumentException - if the class of the specified supplier has not a
static scope.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> withFactory(@NotNull Supplier<? extends Invocation<? super IN,? extends OUT>> supplier)
IN - the input data type.OUT - the output data type.supplier - the supplier instance.IllegalArgumentException - if the class of the specified supplier has not a
static scope.@NotNull public <IN> LoaderRoutineBuilder<IN,IN> withFilter(@NotNull Predicate<? super IN> predicate)
IN - the input data type.predicate - the predicate instance.IllegalArgumentException - if the class of the specified predicate has not a
static scope.@NotNull public LoaderChannelBuilder withId(int loaderId)
MissingLoaderException.
Note that the built routine results will be always dispatched on the configured Looper thread, thus waiting for the outputs immediately after its invocation may result in a deadlock.
loaderId - the Loader ID.@NotNull public LoaderObjectProxyRoutineBuilder withInstanceOf(@NotNull Class<?> targetClass)
FactoryContext as the
application Context.
Note that the built routine results will be always dispatched on the configured Looper thread, thus waiting for the outputs immediately after its invocation may result in a deadlock.
targetClass - the class of the invocation target.@NotNull public LoaderObjectProxyRoutineBuilder withInstanceOf(@NotNull Class<?> targetClass, @Nullable Object... factoryArgs)
FactoryContext as the
application Context.
Note that the built routine results will be always dispatched on the configured Looper thread, thus waiting for the outputs immediately after its invocation may result in a deadlock.
targetClass - the class of the invocation target.factoryArgs - the object factory arguments.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> withMapping(@NotNull Function<? super IN,? extends OUT> function)
IN - the input data type.OUT - the output data type.function - the function instance.IllegalArgumentException - if the class of the specified function has not a
static scope.@NotNull public <IN,OUT> LoaderRoutineBuilder<IN,OUT> withMappingConsumer(@NotNull BiConsumer<? super IN,? super Channel<OUT,?>> consumer)
IN - the input data type.OUT - the output data type.consumer - the consumer instance.IllegalArgumentException - if the class of the specified consumer has not a
static scope.