Class AggregationQuery.Aggregation (2.18.5)

publicstaticfinalclass AggregationQuery.AggregationextendsGeneratedMessageV3implementsAggregationQuery.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

publicstaticfinalintALIAS_FIELD_NUMBER
Field Value
Type Description
int

AVG_FIELD_NUMBER

publicstaticfinalintAVG_FIELD_NUMBER
Field Value
Type Description
int

COUNT_FIELD_NUMBER

publicstaticfinalintCOUNT_FIELD_NUMBER
Field Value
Type Description
int

SUM_FIELD_NUMBER

publicstaticfinalintSUM_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticAggregationQuery.AggregationgetDefaultInstance()
Returns
Type Description
AggregationQuery.Aggregation

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticAggregationQuery.Aggregation.BuildernewBuilder()
Returns
Type Description
AggregationQuery.Aggregation.Builder

newBuilder(AggregationQuery.Aggregation prototype)

publicstaticAggregationQuery.Aggregation.BuildernewBuilder(AggregationQuery.Aggregationprototype)
Parameter
Name Description
prototype AggregationQuery.Aggregation
Returns
Type Description
AggregationQuery.Aggregation.Builder

parseDelimitedFrom(InputStream input)

publicstaticAggregationQuery.AggregationparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticAggregationQuery.AggregationparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticAggregationQuery.AggregationparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticAggregationQuery.AggregationparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticAggregationQuery.AggregationparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticAggregationQuery.AggregationparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticAggregationQuery.AggregationparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticAggregationQuery.AggregationparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticAggregationQuery.AggregationparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticAggregationQuery.AggregationparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticAggregationQuery.AggregationparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticAggregationQuery.AggregationparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AggregationQuery.Aggregation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<AggregationQuery.Aggregation>parser()
Returns
Type Description
Parser<Aggregation>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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.

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.

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

getOperatorCase()

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

getParserForType()

publicParser<AggregationQuery.Aggregation>getParserForType()
Returns
Type Description
Parser<Aggregation>
Overrides

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getSum()

publicAggregationQuery.Aggregation.SumgetSum()

Sum aggregator.

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

Returns
Type Description
AggregationQuery.Aggregation.Sum

The sum.

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.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedAggregationQuery.Aggregation.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
AggregationQuery.Aggregation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

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.