TransactionOptions.Builder

public final 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 methods

@NonNull TransactionOptions

Build the TransactionOptions object.

@NonNull TransactionOptions.Builder
setMaxAttempts(int maxAttempts)

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

Public constructors

Builder

public Builder()

Constructs a new TransactionOptions Builder object.

Builder

public Builder(@NonNull TransactionOptions options)

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

Public methods

build

public @NonNull TransactionOptions build()

Build the TransactionOptions object.

Returns
@NonNull TransactionOptions

The built TransactionOptions object

setMaxAttempts

public @NonNull TransactionOptions.Builder setMaxAttempts(int maxAttempts)

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
@NonNull TransactionOptions.Builder

This builder