Class AggregationQuery.Aggregation.Builder (2.25.2)

publicstaticfinalclass AggregationQuery.Aggregation.BuilderextendsGeneratedMessageV3.Builder<AggregationQuery.Aggregation.Builder>implementsAggregationQuery.AggregationOrBuilder

Defines an aggregation that produces a single result.

Protobuf type google.datastore.v1.AggregationQuery.Aggregation

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicAggregationQuery.Aggregation.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

build()

publicAggregationQuery.Aggregationbuild()
Returns
Type Description
AggregationQuery.Aggregation

buildPartial()

publicAggregationQuery.AggregationbuildPartial()
Returns
Type Description
AggregationQuery.Aggregation

clear()

publicAggregationQuery.Aggregation.Builderclear()
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

clearAlias()

publicAggregationQuery.Aggregation.BuilderclearAlias()

Optional. Optional name of the property to store the result of the aggregation.

If not provided, Datastore will pick a default name following the format property_<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 property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS property_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to entity property name limitations.

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

Returns
Type Description
AggregationQuery.Aggregation.Builder

This builder for chaining.

clearAvg()

publicAggregationQuery.Aggregation.BuilderclearAvg()

Average aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
AggregationQuery.Aggregation.Builder

clearCount()

publicAggregationQuery.Aggregation.BuilderclearCount()

Count aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
AggregationQuery.Aggregation.Builder

clearField(Descriptors.FieldDescriptor field)

publicAggregationQuery.Aggregation.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicAggregationQuery.Aggregation.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

clearOperator()

publicAggregationQuery.Aggregation.BuilderclearOperator()
Returns
Type Description
AggregationQuery.Aggregation.Builder

clearSum()

publicAggregationQuery.Aggregation.BuilderclearSum()

Sum aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
AggregationQuery.Aggregation.Builder

clone()

publicAggregationQuery.Aggregation.Builderclone()
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

getAlias()

publicStringgetAlias()

Optional. Optional name of the property to store the result of the aggregation.

If not provided, Datastore will pick a default name following the format property_<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 property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS property_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to entity property name limitations.

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

Returns
Type Description
String

The alias.

getAliasBytes()

publicByteStringgetAliasBytes()

Optional. Optional name of the property to store the result of the aggregation.

If not provided, Datastore will pick a default name following the format property_<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 property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS property_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to entity property name limitations.

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

Returns
Type Description
ByteString

The bytes for alias.

getAvg()

publicAggregationQuery.Aggregation.AvggetAvg()

Average aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
AggregationQuery.Aggregation.Avg

The avg.

getAvgBuilder()

publicAggregationQuery.Aggregation.Avg.BuildergetAvgBuilder()

Average aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
AggregationQuery.Aggregation.Avg.Builder

getAvgOrBuilder()

publicAggregationQuery.Aggregation.AvgOrBuildergetAvgOrBuilder()

Average aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
AggregationQuery.Aggregation.AvgOrBuilder

getCount()

publicAggregationQuery.Aggregation.CountgetCount()

Count aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
AggregationQuery.Aggregation.Count

The count.

getCountBuilder()

publicAggregationQuery.Aggregation.Count.BuildergetCountBuilder()

Count aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
AggregationQuery.Aggregation.Count.Builder

getCountOrBuilder()

publicAggregationQuery.Aggregation.CountOrBuildergetCountOrBuilder()

Count aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
AggregationQuery.Aggregation.CountOrBuilder

getDefaultInstanceForType()

publicAggregationQuery.AggregationgetDefaultInstanceForType()
Returns
Type Description
AggregationQuery.Aggregation

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getOperatorCase()

publicAggregationQuery.Aggregation.OperatorCasegetOperatorCase()
Returns
Type Description
AggregationQuery.Aggregation.OperatorCase

getSum()

publicAggregationQuery.Aggregation.SumgetSum()

Sum aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
AggregationQuery.Aggregation.Sum

The sum.

getSumBuilder()

publicAggregationQuery.Aggregation.Sum.BuildergetSumBuilder()

Sum aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
AggregationQuery.Aggregation.Sum.Builder

getSumOrBuilder()

publicAggregationQuery.Aggregation.SumOrBuildergetSumOrBuilder()

Sum aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
AggregationQuery.Aggregation.SumOrBuilder

hasAvg()

publicbooleanhasAvg()

Average aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;

Returns
Type Description
boolean

Whether the avg field is set.

hasCount()

publicbooleanhasCount()

Count aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;

Returns
Type Description
boolean

Whether the count field is set.

hasSum()

publicbooleanhasSum()

Sum aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;

Returns
Type Description
boolean

Whether the sum field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeAvg(AggregationQuery.Aggregation.Avg value)

publicAggregationQuery.Aggregation.BuildermergeAvg(AggregationQuery.Aggregation.Avgvalue)

Average aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;

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

mergeCount(AggregationQuery.Aggregation.Count value)

publicAggregationQuery.Aggregation.BuildermergeCount(AggregationQuery.Aggregation.Countvalue)

Count aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;

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

mergeFrom(AggregationQuery.Aggregation other)

publicAggregationQuery.Aggregation.BuildermergeFrom(AggregationQuery.Aggregationother)
Parameter
Name Description
other AggregationQuery.Aggregation
Returns
Type Description
AggregationQuery.Aggregation.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicAggregationQuery.Aggregation.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicAggregationQuery.Aggregation.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

mergeSum(AggregationQuery.Aggregation.Sum value)

publicAggregationQuery.Aggregation.BuildermergeSum(AggregationQuery.Aggregation.Sumvalue)

Sum aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;

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

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalAggregationQuery.Aggregation.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

setAlias(String value)

publicAggregationQuery.Aggregation.BuildersetAlias(Stringvalue)

Optional. Optional name of the property to store the result of the aggregation.

If not provided, Datastore will pick a default name following the format property_<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 property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS property_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to entity property name limitations.

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

Parameter
Name Description
value String

The alias to set.

Returns
Type Description
AggregationQuery.Aggregation.Builder

This builder for chaining.

setAliasBytes(ByteString value)

publicAggregationQuery.Aggregation.BuildersetAliasBytes(ByteStringvalue)

Optional. Optional name of the property to store the result of the aggregation.

If not provided, Datastore will pick a default name following the format property_<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 property_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS property_2 OVER ( ... ); `

Requires:

  • Must be unique across all aggregation aliases.
  • Conform to entity property name limitations.

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

Parameter
Name Description
value ByteString

The bytes for alias to set.

Returns
Type Description
AggregationQuery.Aggregation.Builder

This builder for chaining.

setAvg(AggregationQuery.Aggregation.Avg value)

publicAggregationQuery.Aggregation.BuildersetAvg(AggregationQuery.Aggregation.Avgvalue)

Average aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;

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

setAvg(AggregationQuery.Aggregation.Avg.Builder builderForValue)

publicAggregationQuery.Aggregation.BuildersetAvg(AggregationQuery.Aggregation.Avg.BuilderbuilderForValue)

Average aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;

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

setCount(AggregationQuery.Aggregation.Count value)

publicAggregationQuery.Aggregation.BuildersetCount(AggregationQuery.Aggregation.Countvalue)

Count aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;

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

setCount(AggregationQuery.Aggregation.Count.Builder builderForValue)

publicAggregationQuery.Aggregation.BuildersetCount(AggregationQuery.Aggregation.Count.BuilderbuilderForValue)

Count aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;

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

setField(Descriptors.FieldDescriptor field, Object value)

publicAggregationQuery.Aggregation.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

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

publicAggregationQuery.Aggregation.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

setSum(AggregationQuery.Aggregation.Sum value)

publicAggregationQuery.Aggregation.BuildersetSum(AggregationQuery.Aggregation.Sumvalue)

Sum aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;

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

setSum(AggregationQuery.Aggregation.Sum.Builder builderForValue)

publicAggregationQuery.Aggregation.BuildersetSum(AggregationQuery.Aggregation.Sum.BuilderbuilderForValue)

Sum aggregator.

.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;

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

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalAggregationQuery.Aggregation.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.