public class JRoutineAndroid extends SparseChannels
See JRoutineAndroidCompat for support
of API levels lower than 11.
Created by davide-maestroni on 03/06/2016.
| Modifier and Type | Method and Description |
|---|---|
static ChannelBuilder |
io()
Returns a channel builder.
|
static LoaderBuilder |
on(Activity activity)
Returns a Context based builder of Loader routine builders.
|
static LoaderBuilder |
on(Activity activity,
Context context)
Returns a Context based builder of Loader routine builders.
|
static ServiceBuilder |
on(Context context)
Returns a Context based builder of Service routine builders.
|
static ServiceBuilder |
on(Context context,
Class<? extends InvocationService> serviceClass)
Returns a Context based builder of Service routine builders.
|
static ServiceBuilder |
on(Context context,
Intent service)
Returns a Context based builder of Service routine builders.
|
static LoaderBuilder |
on(Fragment fragment)
Returns a Context based builder of Loader routine builders.
|
static LoaderBuilder |
on(Fragment fragment,
Context context)
Returns a Context based builder of Loader routine builders.
|
static LoaderBuilder |
on(LoaderContext context)
Returns a Context based builder of Loader routine builders.
|
static ServiceBuilder |
on(ServiceContext context)
Returns a Context based builder of Service routine builders.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStream()
Returns a stream routine builder.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStreamAccept(Consumer<Channel<IN,?>> consumer)
Returns a stream routine builder producing only the inputs passed by the specified consumer.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStreamAccept(int count,
Consumer<Channel<IN,?>> consumer)
Returns a stream routine builder producing only the inputs passed by the specified consumer.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStreamGet(int count,
Supplier<IN> supplier)
Returns a stream routine builder producing only the inputs returned by the specified supplier.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStreamGet(Supplier<IN> supplier)
Returns a stream routine builder producing only the inputs returned by the specified supplier.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStreamOf(Channel<?,? extends IN> channel)
Returns a stream routine builder producing only the inputs returned by the specified channel.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStreamOf(IN... inputs)
Returns a stream routine builder producing only the specified inputs.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStreamOf(IN input)
Returns a stream routine builder producing only the specified input.
|
static <IN> LoaderStreamBuilder<IN,IN> |
withStreamOf(Iterable<? extends IN> inputs)
Returns a stream routine builder producing only the inputs returned by the specified iterable.
|
combine, mergeParcelable, selectInputParcelable, selectInputParcelable, selectInputParcelable, selectOutputParcelable, selectOutputParcelable, selectOutputParcelablemergeParcelable, mergeParcelable, mergeParcelable, mergeParcelable, parcelableByteChannel, parcelableByteChannel, parcelableByteChannel, selectableOutputParcelable, selectInputParcelableblend, blend, byteChannel, byteChannel, byteChannel, combine, combine, combine, combine, combine, concat, concat, distribute, distribute, distribute, distribute, fromFuture, fromFutureInterruptIfRunning, join, join, join, join, merge, merge, merge, merge, merge, replay, selectableInput, selectableOutput, selectInput, selectInput, selectInput, selectInput, selectOutput, selectOutput, selectOutput@NotNull public static ChannelBuilder io()
@NotNull public static LoaderBuilder on(@NotNull Activity activity)
activity - the Loader Activity.@NotNull public static LoaderBuilder on(@NotNull Activity activity, @NotNull Context context)
activity - the Loader Activity.context - the Context used to get the application one.@NotNull public static ServiceBuilder on(@NotNull Context context)
context - the Service Context.@NotNull public static ServiceBuilder on(@NotNull Context context, @NotNull Class<? extends InvocationService> serviceClass)
context - the Service Context.serviceClass - the Service class.@NotNull public static ServiceBuilder on(@NotNull Context context, @NotNull Intent service)
context - the Service Context.service - the Service Intent.@NotNull public static LoaderBuilder on(@NotNull Fragment fragment)
fragment - the Loader Fragment.@NotNull public static LoaderBuilder on(@NotNull Fragment fragment, @NotNull Context context)
fragment - the Loader Fragment.context - the Context used to get the application one.@NotNull public static LoaderBuilder on(@NotNull LoaderContext context)
context - the Loader context.@NotNull public static ServiceBuilder on(@NotNull ServiceContext context)
context - the Service context.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStream()
IN - the input data type.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStreamAccept(@NotNull Consumer<Channel<IN,?>> consumer)
IllegalStateException.IN - the input data type.consumer - the consumer instance.IllegalArgumentException - if the class of the specified consumer has not a
static scope.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStreamAccept(int count, @NotNull Consumer<Channel<IN,?>> consumer)
count number of times only when the
invocation completes.
IllegalStateException.IN - the input data type.count - the number of times the consumer is called.consumer - the consumer instance.IllegalArgumentException - if the class of the specified consumer has not a
static scope or the specified count number is 0 or
negative.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStreamGet(@NotNull Supplier<IN> supplier)
IllegalStateException.IN - the input data type.supplier - the supplier instance.IllegalArgumentException - if the class of the specified supplier has not a
static scope.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStreamGet(int count, @NotNull Supplier<IN> supplier)
count number of times only when the
invocation completes.
IllegalStateException.IN - the input data type.count - the number of times the supplier is called.supplier - the supplier instance.IllegalArgumentException - if the class of the specified supplier has not a
static scope or the specified count number is 0 or
negative.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStreamOf(@Nullable IN input)
IllegalStateException.IN - the input data type.input - the input.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStreamOf(@Nullable IN... inputs)
IllegalStateException.IN - the input data type.inputs - the input data.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStreamOf(@Nullable Iterable<? extends IN> inputs)
IllegalStateException.IN - the input data type.inputs - the inputs iterable.@NotNull public static <IN> LoaderStreamBuilder<IN,IN> withStreamOf(@Nullable Channel<?,? extends IN> channel)
IllegalStateException.
Note that the passed channel will be bound as a result of the call, so, in order to support
multiple invocations, consider wrapping the channel in a replayable one, by calling the
Channels.replay(Channel) utility method.
IN - the input data type.channel - the input channel.