Transaction
public class Transaction
The Transaction class encapsulates the functionality needed to perform a transaction on the data at a location. To run a transaction, provide a Handler to runTransaction. That handler will be passed the current data at the location, and must return a Result. A Result can be created using either success or abort.
Summary
Nested types |
|---|
public interface Transaction.HandlerAn object implementing this interface is used to run a transaction, and will be notified of the results of the transaction. |
public class Transaction.ResultInstances of this class represent the desired outcome of a single run of a |
Public constructors |
|---|
Public methods |
|
|---|---|
static @NonNull Transaction.Result |
abort() |
static @NonNull Transaction.Result |
success(@NonNull MutableData resultData) |
Public constructors
Public methods
abort
public static @NonNull Transaction.Result abort()
| Returns | |
|---|---|
@NonNull Transaction.Result |
A |
success
public static @NonNull Transaction.Result success(@NonNull MutableData resultData)
| Parameters | |
|---|---|
@NonNull MutableData resultData |
The desired data at the location |
| Returns | |
|---|---|
@NonNull Transaction.Result |
A |