Class AggregationQuery.Aggregation (2.19.2)
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 static final class AggregationQuery . Aggregation extends GeneratedMessageV3 implements AggregationQuery . AggregationOrBuilder
Defines an aggregation that produces a single result.
Protobuf type google.datastore.v1.AggregationQuery.Aggregation
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
ALIAS_FIELD_NUMBER
public static final int ALIAS_FIELD_NUMBER
Field Value
Type
Description
int
AVG_FIELD_NUMBER
public static final int AVG_FIELD_NUMBER
Field Value
Type
Description
int
COUNT_FIELD_NUMBER
public static final int COUNT_FIELD_NUMBER
Field Value
Type
Description
int
SUM_FIELD_NUMBER
public static final int SUM_FIELD_NUMBER
Field Value
Type
Description
int
Static Methods
getDefaultInstance()
public static AggregationQuery . Aggregation getDefaultInstance ()
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
newBuilder()
public static AggregationQuery . Aggregation . Builder newBuilder ()
newBuilder(AggregationQuery.Aggregation prototype)
public static AggregationQuery . Aggregation . Builder newBuilder ( AggregationQuery . Aggregation prototype )
public static AggregationQuery . Aggregation parseDelimitedFrom ( InputStream input )
public static AggregationQuery . Aggregation parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
parseFrom(byte[] data)
public static AggregationQuery . Aggregation parseFrom ( byte [] data )
Parameter
Name
Description
data
byte []
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static AggregationQuery . Aggregation parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
parseFrom(ByteString data)
public static AggregationQuery . Aggregation parseFrom ( ByteString data )
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static AggregationQuery . Aggregation parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
public static AggregationQuery . Aggregation parseFrom ( CodedInputStream input )
public static AggregationQuery . Aggregation parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
public static AggregationQuery . Aggregation parseFrom ( InputStream input )
public static AggregationQuery . Aggregation parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
parseFrom(ByteBuffer data)
public static AggregationQuery . Aggregation parseFrom ( ByteBuffer data )
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static AggregationQuery . Aggregation parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
parser()
public static Parser<AggregationQuery . Aggregation > parser ()
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter
Name
Description
obj
Object
Overrides
getAlias()
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()
public ByteString getAliasBytes ()
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()
public AggregationQuery . Aggregation . Avg getAvg ()
Average aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;
getAvgOrBuilder()
public AggregationQuery . Aggregation . AvgOrBuilder getAvgOrBuilder ()
Average aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;
getCount()
public AggregationQuery . Aggregation . Count getCount ()
Count aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
getCountOrBuilder()
public AggregationQuery . Aggregation . CountOrBuilder getCountOrBuilder ()
Count aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
getDefaultInstanceForType()
public AggregationQuery . Aggregation getDefaultInstanceForType ()
getOperatorCase()
public AggregationQuery . Aggregation . OperatorCase getOperatorCase ()
getParserForType()
public Parser<AggregationQuery . Aggregation > getParserForType ()
Overrides
getSerializedSize()
public int getSerializedSize ()
Returns
Type
Description
int
Overrides
getSum()
public AggregationQuery . Aggregation . Sum getSum ()
Sum aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;
getSumOrBuilder()
public AggregationQuery . Aggregation . SumOrBuilder getSumOrBuilder ()
Sum aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;
hasAvg()
Average aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3;
Returns
Type
Description
boolean
Whether the avg field is set.
hasCount()
public boolean hasCount ()
Count aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Count count = 1;
Returns
Type
Description
boolean
Whether the count field is set.
hasSum()
Sum aggregator.
.google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2;
Returns
Type
Description
boolean
Whether the sum field is set.
hashCode()
Returns
Type
Description
int
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
newBuilderForType()
public AggregationQuery . Aggregation . Builder newBuilderForType ()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected AggregationQuery . Aggregation . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance ( GeneratedMessageV3 . UnusedPrivateParameter unused )
Returns
Type
Description
Object
Overrides
toBuilder()
public AggregationQuery . Aggregation . Builder toBuilder ()
writeTo(CodedOutputStream output)
public void writeTo ( CodedOutputStream output )
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 2026-06-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-18 UTC."],[],[]]