public static class FlowUseCaseConfig.Builder<T>
Constructs references to lambdas and some basic configuration used to process results of Flow use case.
| Constructor and Description |
|---|
Builder()
Constructs references to lambdas and some basic configuration
used to process results of Flow use case.
|
| Modifier and Type | Method and Description |
|---|---|
CoroutineScopeOwner.FlowUseCaseConfig<T> |
build() |
void |
disposePrevious(boolean disposePrevious)
Set whether currently running Job of internal Flow
should be canceled when execute is called repeatedly.
|
void |
onComplete(kotlin.jvm.functions.Function0<kotlin.Unit> onComplete)
Set lambda that is called when internal Flow is completed
without errors
|
void |
onError(kotlin.jvm.functions.Function1<? super java.lang.Throwable,kotlin.Unit> onError)
Set lambda that is called when some exception on
internal Flow occurs
|
void |
onNext(kotlin.jvm.functions.Function1<? super T,kotlin.Unit> onNext)
Set lambda that is called when internal Flow emits new value
|
void |
onStart(kotlin.jvm.functions.Function0<kotlin.Unit> onStart)
Set lambda that is called right before
internal Job of Flow is launched.
|
public Builder()
Constructs references to lambdas and some basic configuration used to process results of Flow use case.
public void onStart(@NotNull
kotlin.jvm.functions.Function0<kotlin.Unit> onStart)
Set lambda that is called right before internal Job of Flow is launched.
onStart - Lambda called right before Flow Job is launched.public void onNext(@NotNull
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> onNext)
Set lambda that is called when internal Flow emits new value
onNext - Lambda called for every new emitted valuepublic void onError(@NotNull
kotlin.jvm.functions.Function1<? super java.lang.Throwable,kotlin.Unit> onError)
Set lambda that is called when some exception on internal Flow occurs
onError - Lambda called when exception occurspublic void onComplete(@NotNull
kotlin.jvm.functions.Function0<kotlin.Unit> onComplete)
Set lambda that is called when internal Flow is completed without errors
onComplete - Lambda called when Flow is completedwithout errorspublic void disposePrevious(boolean disposePrevious)
Set whether currently running Job of internal Flow should be canceled when execute is called repeatedly.
disposePrevious - True if currently runningJob of internal Flow should be canceled@NotNull public CoroutineScopeOwner.FlowUseCaseConfig<T> build()