only / com.skydoves.only / Only / Builder

Builder

class Builder

Builder class for creating Only.

Constructors

<init>

Builder class for creating Only.

Builder(name: String, times: Int = 1)

Properties

marking

var marking: Any?

name

val name: String

onBeforeDone

var onBeforeDone: () -> Unit

onDo

var onDo: (Int) -> Unit

onDone

var onDone: () -> Unit

onLastDo

var onLastDo: () -> Unit

times

val times: Int

version

var version: String

Functions

mark

marks to the Only data.

fun mark(marking: Any?): Builder

onBeforeDone

executes only once the onBeforeDone block after before executing onDone block.

fun onBeforeDone(onBeforeDone: () -> Unit): Builder
fun onBeforeDone(runnable: Runnable): Builder

onDo

executes the onDo block only as many times as necessary.

fun onDo(onDo: (Int) -> Unit): Builder
fun onDo(runnable: Runnable): Builder

onDone

executes the onDone block after executing x+1 times onDo block.

fun onDone(onDone: () -> Unit): Builder
fun onDone(runnable: Runnable): Builder

onLastDo

executes only once the onLastDo block after finishing x times onDo block.

fun onLastDo(onLastDo: () -> Unit): Builder
fun onLastDo(runnable: Runnable): Builder

run

fun run(): Unit

version

changes version and clear the executed time history.

fun version(version: String): Builder