# Interface TargetOrBuilder (3.43.1)

3.43.1 (latest) 3.41.0 3.38.0 3.37.0 3.36.0 3.35.1 3.33.4 3.32.2 3.31.9 3.30.11 3.28.0 3.27.2 3.26.5 3.25.1 3.24.3 3.22.0 3.21.4 3.20.0 3.17.0 3.16.3 3.15.7 3.14.4 3.13.2 3.12.1 3.11.0 3.10.0 3.9.6 3.8.2 3.7.10 3.6.0 3.5.0 3.4.2 3.3.0 3.2.0 3.1.0 3.0.21

    public interface TargetOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### getDocuments()

    public abstract Target.DocumentsTarget getDocuments()

A target specified by a set of document names.

`.google.firestore.v1.Target.DocumentsTarget documents = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.Target.DocumentsTarget` | The documents. |

### getDocumentsOrBuilder()

    public abstract Target.DocumentsTargetOrBuilder getDocumentsOrBuilder()

A target specified by a set of document names.

`.google.firestore.v1.Target.DocumentsTarget documents = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.Target.DocumentsTargetOrBuilder` |   |

### getExpectedCount()

    public abstract Int32Value getExpectedCount()

The number of documents that last matched the query at the resume token or
read time.

This value is only relevant when a `resume_type` is provided. This value
being present and greater than zero signals that the client wants
`ExistenceFilter.unchanged_names` to be included in the response.

`.google.protobuf.Int32Value expected_count = 12;`

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

### getExpectedCountOrBuilder()

    public abstract Int32ValueOrBuilder getExpectedCountOrBuilder()

The number of documents that last matched the query at the resume token or
read time.

This value is only relevant when a `resume_type` is provided. This value
being present and greater than zero signals that the client wants
`ExistenceFilter.unchanged_names` to be included in the response.

`.google.protobuf.Int32Value expected_count = 12;`

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

### getOnce()

    public abstract boolean getOnce()

If the target should be removed once it is current and consistent.

`bool once = 6;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The once. |

### getQuery()

    public abstract Target.QueryTarget getQuery()

A target specified by a query.

`.google.firestore.v1.Target.QueryTarget query = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.Target.QueryTarget` | The query. |

### getQueryOrBuilder()

    public abstract Target.QueryTargetOrBuilder getQueryOrBuilder()

A target specified by a query.

`.google.firestore.v1.Target.QueryTarget query = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.Target.QueryTargetOrBuilder` |   |

### getReadTime()

    public abstract Timestamp getReadTime()

Start listening after a specific `read_time`.

The client must know the state of matching documents at this time.

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

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

### getReadTimeOrBuilder()

    public abstract TimestampOrBuilder getReadTimeOrBuilder()

Start listening after a specific `read_time`.

The client must know the state of matching documents at this time.

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

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

### getResumeToken()

    public abstract ByteString getResumeToken()

A resume token from a prior
TargetChange for an identical target.

Using a resume token with a different target is unsupported and may fail.

`bytes resume_token = 4;`

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

### getResumeTypeCase()

    public abstract Target.ResumeTypeCase getResumeTypeCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.Target.ResumeTypeCase` |   |

### getTargetId()

    public abstract int getTargetId()

The target ID that identifies the target on the stream. Must be a positive
number and non-zero.

If `target_id` is 0 (or unspecified), the server will assign an ID for this
target and return that in a `TargetChange::ADD` event. Once a target with
`target_id=0` is added, all subsequent targets must also have
`target_id=0`. If an `AddTarget` request with `target_id != 0` is
sent to the server after a target with `target_id=0` is added, the server
will immediately send a response with a `TargetChange::Remove` event.

Note that if the client sends multiple `AddTarget` requests
without an ID, the order of IDs returned in `TargetChange.target_ids` are
undefined. Therefore, clients should provide a target ID instead of relying
on the server to assign one.

If `target_id` is non-zero, there must not be an existing active target on
this stream with the same ID.

`int32 target_id = 5;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The targetId. |

### getTargetTypeCase()

    public abstract Target.TargetTypeCase getTargetTypeCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-firestore/latest/com.google.firestore.v1.Target.TargetTypeCase` |   |

### hasDocuments()

    public abstract boolean hasDocuments()

A target specified by a set of document names.

`.google.firestore.v1.Target.DocumentsTarget documents = 3;`

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

### hasExpectedCount()

    public abstract boolean hasExpectedCount()

The number of documents that last matched the query at the resume token or
read time.

This value is only relevant when a `resume_type` is provided. This value
being present and greater than zero signals that the client wants
`ExistenceFilter.unchanged_names` to be included in the response.

`.google.protobuf.Int32Value expected_count = 12;`

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

### hasQuery()

    public abstract boolean hasQuery()

A target specified by a query.

`.google.firestore.v1.Target.QueryTarget query = 2;`

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

### hasReadTime()

    public abstract boolean hasReadTime()

Start listening after a specific `read_time`.

The client must know the state of matching documents at this time.

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

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

### hasResumeToken()

    public abstract boolean hasResumeToken()

A resume token from a prior
TargetChange for an identical target.

Using a resume token with a different target is unsupported and may fail.

`bytes resume_token = 4;`

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