Summary: Nested Classes | Ctors | Methods | Inherited Methods | [Expand All]
public class

# Transaction

extends Object

java.lang.Object
↳ | com.google.firebase.database.Transaction

## Class Overview

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()`.

## Summary

Nested Classes
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 Constructors
| Transaction()

Public Methods
static Transaction.Result | abort()
static Transaction.Result | success(MutableData resultData)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Constructors

#### public Transaction ()

## Public Methods

#### public static Transaction.Result abort ()

##### Returns

- A `Transaction.Result` that aborts the transaction

#### public static Transaction.Result success (MutableData resultData)

##### Parameters

resultData | The desired data at the location

##### Returns

- A `Transaction.Result` indicating the new data to be stored at the location