Transaction

public class Transaction extends Object

The Transaction class encapsulates the functionality needed to perform a transaction on the data at a location.

To run a transaction, provide a Transaction.Handler to runTransaction(com.google.firebase.database.Transaction.Handler). That handler will be passed the current data at the location, and must return a Transaction.Result. A Transaction.Result can be created using either success(MutableData) or abort().

Nested Class Summary

interface Transaction.Handler An object implementing this interface is used to run a transaction, and will be notified of the results of the transaction. 
class Transaction.Result Instances of this class represent the desired outcome of a single run of a Transaction.Handler's doTransaction method. 

Public Constructor Summary

Public Method Summary

static Transaction.Result
abort()
static Transaction.Result
success(MutableData resultData)

Inherited Method Summary

Public Constructors

public Transaction ()

Public Methods

public static Transaction.Result abort ()

Returns

public static Transaction.Result success (MutableData resultData)

Parameters
resultData The desired data at the location
Returns

发送以下问题的反馈:

此网页
需要帮助?请访问我们的支持页面