Class ParsedAggregation
- java.lang.Object
-
- org.elasticsearch.search.aggregations.ParsedAggregation
-
- All Implemented Interfaces:
ToXContent
,ToXContentFragment
,Aggregation
- Direct Known Subclasses:
ParsedCardinality
,ParsedGeoBounds
,ParsedGeoCentroid
,ParsedMultiBucketAggregation
,ParsedPercentiles
,ParsedScriptedMetric
,ParsedSingleBucketAggregation
,ParsedSingleValueNumericMetricsAggregation
,ParsedStats
,ParsedTopHits
,ParsedValueCount
public abstract class ParsedAggregation extends java.lang.Object implements Aggregation, ToXContentFragment
An implementation ofAggregation
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.CommonFields
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.Object>
metadata
-
Fields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description ParsedAggregation()
-
Method Summary
Modifier and Type Method Description protected static void
declareAggregationFields(ObjectParser<? extends ParsedAggregation,java.lang.Void> objectParser)
protected abstract XContentBuilder
doXContentBody(XContentBuilder builder, ToXContent.Params params)
java.util.Map<java.lang.String,java.lang.Object>
getMetaData()
Get the optional byte array metadata that was set on the aggregationjava.lang.String
getName()
protected static double
parseDouble(XContentParser parser, double defaultNullValue)
Parse a token of type XContentParser.Token.VALUE_NUMBER or XContentParser.Token.STRING to a double.protected void
setName(java.lang.String name)
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getType
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Method Detail
-
declareAggregationFields
protected static void declareAggregationFields(ObjectParser<? extends ParsedAggregation,java.lang.Void> objectParser)
-
getName
public final java.lang.String getName()
- Specified by:
getName
in interfaceAggregation
- Returns:
- The name of this aggregation.
-
setName
protected void setName(java.lang.String name)
-
getMetaData
public final java.util.Map<java.lang.String,java.lang.Object> getMetaData()
Description copied from interface:Aggregation
Get the optional byte array metadata that was set on the aggregation- Specified by:
getMetaData
in interfaceAggregation
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
doXContentBody
protected abstract XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Throws:
java.io.IOException
-
parseDouble
protected static double parseDouble(XContentParser parser, double defaultNullValue) throws java.io.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:
java.io.IOException
-
-