# Interface ReadOptionsOrBuilder (3.1.0)

3.1.0 (latest) 2.40.0 2.37.0 2.36.0 2.34.0 2.33.3 2.32.3 2.31.4 2.30.0 2.29.1 2.28.2 2.27.1 2.26.4 2.25.2 2.24.3 2.23.0 2.22.0 2.21.3 2.20.2 2.19.2 2.18.5 2.17.6

    public interface ReadOptionsOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getConsistencyTypeCase()

    public abstract ReadOptions.ConsistencyTypeCase getConsistencyTypeCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.ReadOptions.ConsistencyTypeCase` |   |

### getNewTransaction()

    public abstract TransactionOptions getNewTransaction()

Options for beginning a new transaction for this request.

The new transaction identifier will be returned in the corresponding
response as either
LookupResponse.transaction
or
RunQueryResponse.transaction.

`.google.datastore.v1.TransactionOptions new_transaction = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.TransactionOptions` | The newTransaction. |

### getNewTransactionOrBuilder()

    public abstract TransactionOptionsOrBuilder getNewTransactionOrBuilder()

Options for beginning a new transaction for this request.

The new transaction identifier will be returned in the corresponding
response as either
LookupResponse.transaction
or
RunQueryResponse.transaction.

`.google.datastore.v1.TransactionOptions new_transaction = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.TransactionOptionsOrBuilder` |   |

### getReadConsistency()

    public abstract ReadOptions.ReadConsistency getReadConsistency()

The non-transactional read consistency to use.

`.google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.ReadOptions.ReadConsistency` | The readConsistency. |

### getReadConsistencyValue()

    public abstract int getReadConsistencyValue()

The non-transactional read consistency to use.

`.google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for readConsistency. |

### getReadTime()

    public abstract Timestamp getReadTime()

Reads entities as they were at the given time. This value is only
supported for Cloud Firestore in Datastore mode.

This must be a microsecond precision timestamp within the past one hour,
or if Point-in-Time Recovery is enabled, can additionally be a whole
minute timestamp within the past 7 days.

`.google.protobuf.Timestamp read_time = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The readTime. |

### getReadTimeOrBuilder()

    public abstract TimestampOrBuilder getReadTimeOrBuilder()

Reads entities as they were at the given time. This value is only
supported for Cloud Firestore in Datastore mode.

This must be a microsecond precision timestamp within the past one hour,
or if Point-in-Time Recovery is enabled, can additionally be a whole
minute timestamp within the past 7 days.

`.google.protobuf.Timestamp read_time = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### getTransaction()

    public abstract ByteString getTransaction()

The identifier of the transaction in which to read. A
transaction identifier is returned by a call to
Datastore.BeginTransaction.

`bytes transaction = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The transaction. |

### hasNewTransaction()

    public abstract boolean hasNewTransaction()

Options for beginning a new transaction for this request.

The new transaction identifier will be returned in the corresponding
response as either
LookupResponse.transaction
or
RunQueryResponse.transaction.

`.google.datastore.v1.TransactionOptions new_transaction = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the newTransaction field is set. |

### hasReadConsistency()

    public abstract boolean hasReadConsistency()

The non-transactional read consistency to use.

`.google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the readConsistency field is set. |

### hasReadTime()

    public abstract boolean hasReadTime()

Reads entities as they were at the given time. This value is only
supported for Cloud Firestore in Datastore mode.

This must be a microsecond precision timestamp within the past one hour,
or if Point-in-Time Recovery is enabled, can additionally be a whole
minute timestamp within the past 7 days.

`.google.protobuf.Timestamp read_time = 4;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the readTime field is set. |

### hasTransaction()

    public abstract boolean hasTransaction()

The identifier of the transaction in which to read. A
transaction identifier is returned by a call to
Datastore.BeginTransaction.

`bytes transaction = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the transaction field is set. |