-
public final class CoroutineScopeOwner.UseCaseConfig.Builder<T extends Object>Constructs references to lambdas and some basic configuration used to process results of Coroutine use case.
-
-
Constructor Summary
Constructors Constructor Description CoroutineScopeOwner.UseCaseConfig.Builder()
-
Method Summary
Modifier and Type Method Description final UnitonStart(Function0<Unit> onStart)Set lambda that is called right before the internal Coroutine is created final UnitonSuccess(Function1<T, Unit> onSuccess)Set lambda that is called when internal Coroutine finished without exceptions final UnitonError(Function1<Throwable, Unit> onError)Set lambda that is called when exception on internal Coroutine occurs final UnitdisposePrevious(Boolean disposePrevious)Set whether currently active Job of internal Coroutine should be canceled when execute is called repeatedly. final CoroutineScopeOwner.UseCaseConfig<T>build()-
-
Method Detail
-
onStart
final Unit onStart(Function0<Unit> onStart)
Set lambda that is called right before the internal Coroutine is created
- Parameters:
onStart- Lambda called right before Coroutine is created
-
onSuccess
final Unit onSuccess(Function1<T, Unit> onSuccess)
Set lambda that is called when internal Coroutine finished without exceptions
- Parameters:
onSuccess- Lambda called when Coroutine finished
-
onError
final Unit onError(Function1<Throwable, Unit> onError)
Set lambda that is called when exception on internal Coroutine occurs
- Parameters:
onError- Lambda called when exception occurs
-
disposePrevious
final Unit disposePrevious(Boolean disposePrevious)
Set whether currently active Job of internal Coroutine should be canceled when execute is called repeatedly. Default value is true.
- Parameters:
disposePrevious- True if active Job of internal Coroutine should be canceled.
-
build
final CoroutineScopeOwner.UseCaseConfig<T> build()
-
-
-
-