-
public final class CoroutineScopeOwner.FlowUseCaseConfig.Builder<T extends Object>Constructs references to lambdas and some basic configuration used to process results of Flow use case.
-
-
Constructor Summary
Constructors Constructor Description CoroutineScopeOwner.FlowUseCaseConfig.Builder()
-
Method Summary
Modifier and Type Method Description final UnitonStart(Function0<Unit> onStart)Set lambda that is called right before internal Job of Flow is launched. final UnitonNext(Function1<T, Unit> onNext)Set lambda that is called when internal Flow emits new value final UnitonError(Function1<Throwable, Unit> onError)Set lambda that is called when some exception on internal Flow occurs final UnitonComplete(Function0<Unit> onComplete)Set lambda that is called when internal Flow is completed without errors final UnitdisposePrevious(Boolean disposePrevious)Set whether currently running Job of internal Flow should be canceled when execute is called repeatedly. final CoroutineScopeOwner.FlowUseCaseConfig<T>build()-
-
Method Detail
-
onStart
final Unit onStart(Function0<Unit> onStart)
Set lambda that is called right before internal Job of Flow is launched.
- Parameters:
onStart- Lambda called right before Flow Job is launched.
-
onNext
final Unit onNext(Function1<T, Unit> onNext)
Set lambda that is called when internal Flow emits new value
- Parameters:
onNext- Lambda called for every new emitted value
-
onError
final Unit onError(Function1<Throwable, Unit> onError)
Set lambda that is called when some exception on internal Flow occurs
- Parameters:
onError- Lambda called when exception occurs
-
onComplete
final Unit onComplete(Function0<Unit> onComplete)
Set lambda that is called when internal Flow is completed without errors
- Parameters:
onComplete- Lambda called when Flow is completed without errors
-
disposePrevious
final Unit disposePrevious(Boolean disposePrevious)
Set whether currently running Job of internal Flow should be canceled when execute is called repeatedly.
- Parameters:
disposePrevious- True if currently running Job of internal Flow should be canceled
-
build
final CoroutineScopeOwner.FlowUseCaseConfig<T> build()
-
-
-
-