Class ParsedAggregation
java.lang.Object
org.elasticsearch.search.aggregations.ParsedAggregation
- All Implemented Interfaces:
Aggregation,ToXContent,ToXContentFragment
- Direct Known Subclasses:
ParsedCardinality,ParsedGeoBounds,ParsedGeoCentroid,ParsedMultiBucketAggregation,ParsedPercentiles,ParsedScriptedMetric,ParsedSingleBucketAggregation,ParsedSingleValueNumericMetricsAggregation,ParsedStats,ParsedTopHits,ParsedValueCount
An implementation of
Aggregation that is parsed from a REST response.
Serves as a base class for all aggregation implementations that are parsed from REST.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
FieldsFields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITERFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voiddeclareAggregationFields(AbstractObjectParser<? extends ParsedAggregation, ?> objectParser) protected abstract XContentBuilderdoXContentBody(XContentBuilder builder, ToXContent.Params params) Get the optional byte array metadata that was set on the aggregationfinal StringgetName()protected static doubleparseDouble(XContentParser parser, double defaultNullValue) Parse a token of type XContentParser.Token.VALUE_NUMBER or XContentParser.Token.STRING to a double.protected voidtoXContent(XContentBuilder builder, ToXContent.Params params) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getTypeMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
metadata
-
-
Constructor Details
-
ParsedAggregation
public ParsedAggregation()
-
-
Method Details
-
declareAggregationFields
protected static void declareAggregationFields(AbstractObjectParser<? extends ParsedAggregation, ?> objectParser) -
getName
- Specified by:
getNamein interfaceAggregation- Returns:
- The name of this aggregation.
-
setName
-
getMetadata
Description copied from interface:AggregationGet the optional byte array metadata that was set on the aggregation- Specified by:
getMetadatain interfaceAggregation
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
doXContentBody
protected abstract XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
parseDouble
protected static double parseDouble(XContentParser parser, double defaultNullValue) throws IOException Parse a token of type XContentParser.Token.VALUE_NUMBER or XContentParser.Token.STRING to a double. In other cases the default value is returned instead.- Throws:
IOException
-