TransactionOptions.Builder

class TransactionOptions.Builder


A Builder for creating TransactionOptions.

Summary

Public constructors

Constructs a new TransactionOptions Builder object.

Constructs a new TransactionOptions Builder based on an existing TransactionOptions object.

Public functions

TransactionOptions

Build the TransactionOptions object.

TransactionOptions.Builder
setMaxAttempts(maxAttempts: Int)

Set maximum number of attempts to commit, after which transaction fails.

Public constructors

Builder

Builder()

Constructs a new TransactionOptions Builder object.

Builder

Builder(options: TransactionOptions)

Constructs a new TransactionOptions Builder based on an existing TransactionOptions object.

Public functions

build

fun build(): TransactionOptions

Build the TransactionOptions object.

Returns
TransactionOptions

The built TransactionOptions object

setMaxAttempts

fun setMaxAttempts(maxAttempts: Int): TransactionOptions.Builder

Set maximum number of attempts to commit, after which transaction fails.

The default value is 5. Setting the value to less than 1 will result in an IllegalArgumentException.

Returns
TransactionOptions.Builder

This builder