# Interface AggregationQueryOrBuilder (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 AggregationQueryOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### getAggregations(int index)

    public abstract AggregationQuery.Aggregation getAggregations(int index)

Optional. Series of aggregations to apply over the results of the
`nested_query`.

Requires:

- A minimum of one and maximum of five aggregations per query.

`
repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

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

### getAggregationsCount()

    public abstract int getAggregationsCount()

Optional. Series of aggregations to apply over the results of the
`nested_query`.

Requires:

- A minimum of one and maximum of five aggregations per query.

`
repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
`

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

### getAggregationsList()

    public abstract List<AggregationQuery.Aggregation> getAggregationsList()

Optional. Series of aggregations to apply over the results of the
`nested_query`.

Requires:

- A minimum of one and maximum of five aggregations per query.

`
repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.AggregationQuery.Aggregation>` |   |

### getAggregationsOrBuilder(int index)

    public abstract AggregationQuery.AggregationOrBuilder getAggregationsOrBuilder(int index)

Optional. Series of aggregations to apply over the results of the
`nested_query`.

Requires:

- A minimum of one and maximum of five aggregations per query.

`
repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

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

### getAggregationsOrBuilderList()

    public abstract List<? extends AggregationQuery.AggregationOrBuilder> getAggregationsOrBuilderList()

Optional. Series of aggregations to apply over the results of the
`nested_query`.

Requires:

- A minimum of one and maximum of five aggregations per query.

`
repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.datastore.v1.AggregationQuery.AggregationOrBuilder>` |   |

### getNestedQuery()

    public abstract Query getNestedQuery()

Nested query for aggregation

`.google.datastore.v1.Query nested_query = 1;`

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

### getNestedQueryOrBuilder()

    public abstract QueryOrBuilder getNestedQueryOrBuilder()

Nested query for aggregation

`.google.datastore.v1.Query nested_query = 1;`

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

### getQueryTypeCase()

    public abstract AggregationQuery.QueryTypeCase getQueryTypeCase()

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

### hasNestedQuery()

    public abstract boolean hasNestedQuery()

Nested query for aggregation

`.google.datastore.v1.Query nested_query = 1;`

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