Class StructuredAggregationQuery.Aggregation.Builder (3.30.0)

public static final class StructuredAggregationQuery.Aggregation.Builder extends GeneratedMessageV3.Builder<StructuredAggregationQuery.Aggregation.Builder> implements StructuredAggregationQuery.AggregationOrBuilder

Defines an aggregation that produces a single result.

Protobuf type google.firestore.v1.StructuredAggregationQuery.Aggregation

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public StructuredAggregationQuery.Aggregation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

build()

public StructuredAggregationQuery.Aggregation build()
Returns
Type Description
StructuredAggregationQuery.Aggregation

buildPartial()

public StructuredAggregationQuery.Aggregation buildPartial()
Returns
Type Description
StructuredAggregationQuery.Aggregation

clear()

public StructuredAggregationQuery.Aggregation.Builder clear()
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

clearAlias()

public StructuredAggregationQuery.Aggregation.Builder clearAlias()

Optional. Optional name of the field to store the result of the aggregation into.

If not provided, Firestore will pick a default name following the format field_<incremental_id++>. For example:

` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) OVER ( ... );

becomes:

AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS field_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to document field name limitations.

string alias = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

This builder for chaining.

clearAvg()

public StructuredAggregationQuery.Aggregation.Builder clearAvg()

Average aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

clearCount()

public StructuredAggregationQuery.Aggregation.Builder clearCount()

Count aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

clearField(Descriptors.FieldDescriptor field)

public StructuredAggregationQuery.Aggregation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public StructuredAggregationQuery.Aggregation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

clearOperator()

public StructuredAggregationQuery.Aggregation.Builder clearOperator()
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

clearSum()

public StructuredAggregationQuery.Aggregation.Builder clearSum()

Sum aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

clone()

public StructuredAggregationQuery.Aggregation.Builder clone()
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

getAlias()

public String getAlias()

Optional. Optional name of the field to store the result of the aggregation into.

If not provided, Firestore will pick a default name following the format field_<incremental_id++>. For example:

` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) OVER ( ... );

becomes:

AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS field_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to document field name limitations.

string alias = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The alias.

getAliasBytes()

public ByteString getAliasBytes()

Optional. Optional name of the field to store the result of the aggregation into.

If not provided, Firestore will pick a default name following the format field_<incremental_id++>. For example:

` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) OVER ( ... );

becomes:

AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS field_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to document field name limitations.

string alias = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for alias.

getAvg()

public StructuredAggregationQuery.Aggregation.Avg getAvg()

Average aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Avg

The avg.

getAvgBuilder()

public StructuredAggregationQuery.Aggregation.Avg.Builder getAvgBuilder()

Average aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Avg.Builder

getAvgOrBuilder()

public StructuredAggregationQuery.Aggregation.AvgOrBuilder getAvgOrBuilder()

Average aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
StructuredAggregationQuery.Aggregation.AvgOrBuilder

getCount()

public StructuredAggregationQuery.Aggregation.Count getCount()

Count aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Count

The count.

getCountBuilder()

public StructuredAggregationQuery.Aggregation.Count.Builder getCountBuilder()

Count aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Count.Builder

getCountOrBuilder()

public StructuredAggregationQuery.Aggregation.CountOrBuilder getCountOrBuilder()

Count aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
StructuredAggregationQuery.Aggregation.CountOrBuilder

getDefaultInstanceForType()

public StructuredAggregationQuery.Aggregation getDefaultInstanceForType()
Returns
Type Description
StructuredAggregationQuery.Aggregation

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getOperatorCase()

public StructuredAggregationQuery.Aggregation.OperatorCase getOperatorCase()
Returns
Type Description
StructuredAggregationQuery.Aggregation.OperatorCase

getSum()

public StructuredAggregationQuery.Aggregation.Sum getSum()

Sum aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Sum

The sum.

getSumBuilder()

public StructuredAggregationQuery.Aggregation.Sum.Builder getSumBuilder()

Sum aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
StructuredAggregationQuery.Aggregation.Sum.Builder

getSumOrBuilder()

public StructuredAggregationQuery.Aggregation.SumOrBuilder getSumOrBuilder()

Sum aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
StructuredAggregationQuery.Aggregation.SumOrBuilder

hasAvg()

public boolean hasAvg()

Average aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
boolean

Whether the avg field is set.

hasCount()

public boolean hasCount()

Count aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
boolean

Whether the count field is set.

hasSum()

public boolean hasSum()

Sum aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
boolean

Whether the sum field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeAvg(StructuredAggregationQuery.Aggregation.Avg value)

public StructuredAggregationQuery.Aggregation.Builder mergeAvg(StructuredAggregationQuery.Aggregation.Avg value)

Average aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3;

Parameter
Name Description
value StructuredAggregationQuery.Aggregation.Avg
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

mergeCount(StructuredAggregationQuery.Aggregation.Count value)

public StructuredAggregationQuery.Aggregation.Builder mergeCount(StructuredAggregationQuery.Aggregation.Count value)

Count aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1;

Parameter
Name Description
value StructuredAggregationQuery.Aggregation.Count
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

mergeFrom(StructuredAggregationQuery.Aggregation other)

public StructuredAggregationQuery.Aggregation.Builder mergeFrom(StructuredAggregationQuery.Aggregation other)
Parameter
Name Description
other StructuredAggregationQuery.Aggregation
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public StructuredAggregationQuery.Aggregation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public StructuredAggregationQuery.Aggregation.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

mergeSum(StructuredAggregationQuery.Aggregation.Sum value)

public StructuredAggregationQuery.Aggregation.Builder mergeSum(StructuredAggregationQuery.Aggregation.Sum value)

Sum aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2;

Parameter
Name Description
value StructuredAggregationQuery.Aggregation.Sum
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final StructuredAggregationQuery.Aggregation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

setAlias(String value)

public StructuredAggregationQuery.Aggregation.Builder setAlias(String value)

Optional. Optional name of the field to store the result of the aggregation into.

If not provided, Firestore will pick a default name following the format field_<incremental_id++>. For example:

` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) OVER ( ... );

becomes:

AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS field_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to document field name limitations.

string alias = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The alias to set.

Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

This builder for chaining.

setAliasBytes(ByteString value)

public StructuredAggregationQuery.Aggregation.Builder setAliasBytes(ByteString value)

Optional. Optional name of the field to store the result of the aggregation into.

If not provided, Firestore will pick a default name following the format field_<incremental_id++>. For example:

` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) OVER ( ... );

becomes:

AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS field_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to document field name limitations.

string alias = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for alias to set.

Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

This builder for chaining.

setAvg(StructuredAggregationQuery.Aggregation.Avg value)

public StructuredAggregationQuery.Aggregation.Builder setAvg(StructuredAggregationQuery.Aggregation.Avg value)

Average aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3;

Parameter
Name Description
value StructuredAggregationQuery.Aggregation.Avg
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

setAvg(StructuredAggregationQuery.Aggregation.Avg.Builder builderForValue)

public StructuredAggregationQuery.Aggregation.Builder setAvg(StructuredAggregationQuery.Aggregation.Avg.Builder builderForValue)

Average aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Avg avg = 3;

Parameter
Name Description
builderForValue StructuredAggregationQuery.Aggregation.Avg.Builder
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

setCount(StructuredAggregationQuery.Aggregation.Count value)

public StructuredAggregationQuery.Aggregation.Builder setCount(StructuredAggregationQuery.Aggregation.Count value)

Count aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1;

Parameter
Name Description
value StructuredAggregationQuery.Aggregation.Count
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

setCount(StructuredAggregationQuery.Aggregation.Count.Builder builderForValue)

public StructuredAggregationQuery.Aggregation.Builder setCount(StructuredAggregationQuery.Aggregation.Count.Builder builderForValue)

Count aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Count count = 1;

Parameter
Name Description
builderForValue StructuredAggregationQuery.Aggregation.Count.Builder
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public StructuredAggregationQuery.Aggregation.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public StructuredAggregationQuery.Aggregation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides

setSum(StructuredAggregationQuery.Aggregation.Sum value)

public StructuredAggregationQuery.Aggregation.Builder setSum(StructuredAggregationQuery.Aggregation.Sum value)

Sum aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2;

Parameter
Name Description
value StructuredAggregationQuery.Aggregation.Sum
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

setSum(StructuredAggregationQuery.Aggregation.Sum.Builder builderForValue)

public StructuredAggregationQuery.Aggregation.Builder setSum(StructuredAggregationQuery.Aggregation.Sum.Builder builderForValue)

Sum aggregator.

.google.firestore.v1.StructuredAggregationQuery.Aggregation.Sum sum = 2;

Parameter
Name Description
builderForValue StructuredAggregationQuery.Aggregation.Sum.Builder
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final StructuredAggregationQuery.Aggregation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
StructuredAggregationQuery.Aggregation.Builder
Overrides