java.lang.Object
co.elastic.clients.elasticsearch._types.aggregations.Aggregate
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<Aggregate.Kind,​AggregateVariant>

public class Aggregate
extends java.lang.Object
implements TaggedUnion<Aggregate.Kind,​AggregateVariant>, JsonpSerializable
See Also:
API specification
  • Field Details

  • Constructor Details

  • Method Details

    • _kind

      public final Aggregate.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<Aggregate.Kind,​AggregateVariant>
      Returns:
      the variant kind
    • _get

      public final AggregateVariant _get()
      Specified by:
      _get in interface TaggedUnion<Aggregate.Kind,​AggregateVariant>
    • of

      public static Aggregate of​(java.util.function.Function<Aggregate.Builder,​ObjectBuilder<Aggregate>> fn)
    • isAdjacencyMatrix

      public boolean isAdjacencyMatrix()
      Is this variant instance of kind adjacency_matrix?
    • adjacencyMatrix

      public AdjacencyMatrixAggregate adjacencyMatrix()
      Get the adjacency_matrix variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the adjacency_matrix kind.
    • isAutoDateHistogram

      public boolean isAutoDateHistogram()
      Is this variant instance of kind auto_date_histogram?
    • autoDateHistogram

      public AutoDateHistogramAggregate autoDateHistogram()
      Get the auto_date_histogram variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the auto_date_histogram kind.
    • isAvg

      public boolean isAvg()
      Is this variant instance of kind avg?
    • avg

      public AvgAggregate avg()
      Get the avg variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the avg kind.
    • isBoxPlot

      public boolean isBoxPlot()
      Is this variant instance of kind box_plot?
    • boxPlot

      public BoxPlotAggregate boxPlot()
      Get the box_plot variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the box_plot kind.
    • isBucketMetricValue

      public boolean isBucketMetricValue()
      Is this variant instance of kind bucket_metric_value?
    • bucketMetricValue

      public BucketMetricValueAggregate bucketMetricValue()
      Get the bucket_metric_value variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the bucket_metric_value kind.
    • isCardinality

      public boolean isCardinality()
      Is this variant instance of kind cardinality?
    • cardinality

      public CardinalityAggregate cardinality()
      Get the cardinality variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the cardinality kind.
    • isChildren

      public boolean isChildren()
      Is this variant instance of kind children?
    • children

      public ChildrenAggregate children()
      Get the children variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the children kind.
    • isComposite

      public boolean isComposite()
      Is this variant instance of kind composite?
    • composite

      public CompositeAggregate composite()
      Get the composite variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the composite kind.
    • isSimpleLongValue

      public boolean isSimpleLongValue()
      Is this variant instance of kind simple_long_value?
    • simpleLongValue

      public CumulativeCardinalityAggregate simpleLongValue()
      Get the simple_long_value variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the simple_long_value kind.
    • isDateHistogram

      public boolean isDateHistogram()
      Is this variant instance of kind date_histogram?
    • dateHistogram

      public DateHistogramAggregate dateHistogram()
      Get the date_histogram variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the date_histogram kind.
    • isDateRange

      public boolean isDateRange()
      Is this variant instance of kind date_range?
    • dateRange

      public DateRangeAggregate dateRange()
      Get the date_range variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the date_range kind.
    • isDerivative

      public boolean isDerivative()
      Is this variant instance of kind derivative?
    • derivative

      public DerivativeAggregate derivative()
      Get the derivative variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the derivative kind.
    • isDterms

      public boolean isDterms()
      Is this variant instance of kind dterms?
    • dterms

      public DoubleTermsAggregate dterms()
      Get the dterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the dterms kind.
    • isExtendedStats

      public boolean isExtendedStats()
      Is this variant instance of kind extended_stats?
    • extendedStats

      public ExtendedStatsAggregate extendedStats()
      Get the extended_stats variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the extended_stats kind.
    • isExtendedStatsBucket

      public boolean isExtendedStatsBucket()
      Is this variant instance of kind extended_stats_bucket?
    • extendedStatsBucket

      public ExtendedStatsBucketAggregate extendedStatsBucket()
      Get the extended_stats_bucket variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the extended_stats_bucket kind.
    • isFilter

      public boolean isFilter()
      Is this variant instance of kind filter?
    • filter

      public FilterAggregate filter()
      Get the filter variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the filter kind.
    • isFilters

      public boolean isFilters()
      Is this variant instance of kind filters?
    • filters

      public FiltersAggregate filters()
      Get the filters variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the filters kind.
    • isGeoBounds

      public boolean isGeoBounds()
      Is this variant instance of kind geo_bounds?
    • geoBounds

      public GeoBoundsAggregate geoBounds()
      Get the geo_bounds variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_bounds kind.
    • isGeoCentroid

      public boolean isGeoCentroid()
      Is this variant instance of kind geo_centroid?
    • geoCentroid

      public GeoCentroidAggregate geoCentroid()
      Get the geo_centroid variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_centroid kind.
    • isGeoDistance

      public boolean isGeoDistance()
      Is this variant instance of kind geo_distance?
    • geoDistance

      public GeoDistanceAggregate geoDistance()
      Get the geo_distance variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_distance kind.
    • isGeohashGrid

      public boolean isGeohashGrid()
      Is this variant instance of kind geohash_grid?
    • geohashGrid

      public GeoHashGridAggregate geohashGrid()
      Get the geohash_grid variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geohash_grid kind.
    • isGeoLine

      public boolean isGeoLine()
      Is this variant instance of kind geo_line?
    • geoLine

      public GeoLineAggregate geoLine()
      Get the geo_line variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_line kind.
    • isGeotileGrid

      public boolean isGeotileGrid()
      Is this variant instance of kind geotile_grid?
    • geotileGrid

      public GeoTileGridAggregate geotileGrid()
      Get the geotile_grid variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geotile_grid kind.
    • isGlobal

      public boolean isGlobal()
      Is this variant instance of kind global?
    • global

      public GlobalAggregate global()
      Get the global variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the global kind.
    • isHdrPercentileRanks

      public boolean isHdrPercentileRanks()
      Is this variant instance of kind hdr_percentile_ranks?
    • hdrPercentileRanks

      public HdrPercentileRanksAggregate hdrPercentileRanks()
      Get the hdr_percentile_ranks variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the hdr_percentile_ranks kind.
    • isHdrPercentiles

      public boolean isHdrPercentiles()
      Is this variant instance of kind hdr_percentiles?
    • hdrPercentiles

      public HdrPercentilesAggregate hdrPercentiles()
      Get the hdr_percentiles variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the hdr_percentiles kind.
    • isHistogram

      public boolean isHistogram()
      Is this variant instance of kind histogram?
    • histogram

      public HistogramAggregate histogram()
      Get the histogram variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the histogram kind.
    • isInference

      public boolean isInference()
      Is this variant instance of kind inference?
    • inference

      public InferenceAggregate inference()
      Get the inference variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the inference kind.
    • isIpRange

      public boolean isIpRange()
      Is this variant instance of kind ip_range?
    • ipRange

      public IpRangeAggregate ipRange()
      Get the ip_range variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the ip_range kind.
    • isLrareterms

      public boolean isLrareterms()
      Is this variant instance of kind lrareterms?
    • lrareterms

      public LongRareTermsAggregate lrareterms()
      Get the lrareterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the lrareterms kind.
    • isLterms

      public boolean isLterms()
      Is this variant instance of kind lterms?
    • lterms

      public LongTermsAggregate lterms()
      Get the lterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the lterms kind.
    • isMatrixStats

      public boolean isMatrixStats()
      Is this variant instance of kind matrix_stats?
    • matrixStats

      public MatrixStatsAggregate matrixStats()
      Get the matrix_stats variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the matrix_stats kind.
    • isMax

      public boolean isMax()
      Is this variant instance of kind max?
    • max

      public MaxAggregate max()
      Get the max variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the max kind.
    • isMedianAbsoluteDeviation

      public boolean isMedianAbsoluteDeviation()
      Is this variant instance of kind median_absolute_deviation?
    • medianAbsoluteDeviation

      public MedianAbsoluteDeviationAggregate medianAbsoluteDeviation()
      Get the median_absolute_deviation variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the median_absolute_deviation kind.
    • isMin

      public boolean isMin()
      Is this variant instance of kind min?
    • min

      public MinAggregate min()
      Get the min variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the min kind.
    • isMissing

      public boolean isMissing()
      Is this variant instance of kind missing?
    • missing

      public MissingAggregate missing()
      Get the missing variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the missing kind.
    • isMultiTerms

      public boolean isMultiTerms()
      Is this variant instance of kind multi_terms?
    • multiTerms

      public MultiTermsAggregate multiTerms()
      Get the multi_terms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the multi_terms kind.
    • isNested

      public boolean isNested()
      Is this variant instance of kind nested?
    • nested

      public NestedAggregate nested()
      Get the nested variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the nested kind.
    • isPercentilesBucket

      public boolean isPercentilesBucket()
      Is this variant instance of kind percentiles_bucket?
    • percentilesBucket

      public PercentilesBucketAggregate percentilesBucket()
      Get the percentiles_bucket variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the percentiles_bucket kind.
    • isRange

      public boolean isRange()
      Is this variant instance of kind range?
    • range

      public RangeAggregate range()
      Get the range variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the range kind.
    • isRate

      public boolean isRate()
      Is this variant instance of kind rate?
    • rate

      public RateAggregate rate()
      Get the rate variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the rate kind.
    • isReverseNested

      public boolean isReverseNested()
      Is this variant instance of kind reverse_nested?
    • reverseNested

      public ReverseNestedAggregate reverseNested()
      Get the reverse_nested variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the reverse_nested kind.
    • isSampler

      public boolean isSampler()
      Is this variant instance of kind sampler?
    • sampler

      public SamplerAggregate sampler()
      Get the sampler variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the sampler kind.
    • isScriptedMetric

      public boolean isScriptedMetric()
      Is this variant instance of kind scripted_metric?
    • scriptedMetric

      public ScriptedMetricAggregate scriptedMetric()
      Get the scripted_metric variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the scripted_metric kind.
    • isSiglterms

      public boolean isSiglterms()
      Is this variant instance of kind siglterms?
    • siglterms

      public SignificantLongTermsAggregate siglterms()
      Get the siglterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the siglterms kind.
    • isSigsterms

      public boolean isSigsterms()
      Is this variant instance of kind sigsterms?
    • sigsterms

      public SignificantStringTermsAggregate sigsterms()
      Get the sigsterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the sigsterms kind.
    • isSimpleValue

      public boolean isSimpleValue()
      Is this variant instance of kind simple_value?
    • simpleValue

      public SimpleValueAggregate simpleValue()
      Get the simple_value variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the simple_value kind.
    • isStats

      public boolean isStats()
      Is this variant instance of kind stats?
    • stats

      public StatsAggregate stats()
      Get the stats variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the stats kind.
    • isStatsBucket

      public boolean isStatsBucket()
      Is this variant instance of kind stats_bucket?
    • statsBucket

      public StatsBucketAggregate statsBucket()
      Get the stats_bucket variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the stats_bucket kind.
    • isSrareterms

      public boolean isSrareterms()
      Is this variant instance of kind srareterms?
    • srareterms

      public StringRareTermsAggregate srareterms()
      Get the srareterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the srareterms kind.
    • isStringStats

      public boolean isStringStats()
      Is this variant instance of kind string_stats?
    • stringStats

      public StringStatsAggregate stringStats()
      Get the string_stats variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the string_stats kind.
    • isSterms

      public boolean isSterms()
      Is this variant instance of kind sterms?
    • sterms

      public StringTermsAggregate sterms()
      Get the sterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the sterms kind.
    • isSum

      public boolean isSum()
      Is this variant instance of kind sum?
    • sum

      public SumAggregate sum()
      Get the sum variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the sum kind.
    • isTdigestPercentileRanks

      public boolean isTdigestPercentileRanks()
      Is this variant instance of kind tdigest_percentile_ranks?
    • tdigestPercentileRanks

      public TDigestPercentileRanksAggregate tdigestPercentileRanks()
      Get the tdigest_percentile_ranks variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the tdigest_percentile_ranks kind.
    • isTdigestPercentiles

      public boolean isTdigestPercentiles()
      Is this variant instance of kind tdigest_percentiles?
    • tdigestPercentiles

      public TDigestPercentilesAggregate tdigestPercentiles()
      Get the tdigest_percentiles variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the tdigest_percentiles kind.
    • isTTest

      public boolean isTTest()
      Is this variant instance of kind t_test?
    • tTest

      public TTestAggregate tTest()
      Get the t_test variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the t_test kind.
    • isTopHits

      public boolean isTopHits()
      Is this variant instance of kind top_hits?
    • topHits

      public TopHitsAggregate topHits()
      Get the top_hits variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the top_hits kind.
    • isTopMetrics

      public boolean isTopMetrics()
      Is this variant instance of kind top_metrics?
    • topMetrics

      public TopMetricsAggregate topMetrics()
      Get the top_metrics variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the top_metrics kind.
    • isUmrareterms

      public boolean isUmrareterms()
      Is this variant instance of kind umrareterms?
    • umrareterms

      public UnmappedRareTermsAggregate umrareterms()
      Get the umrareterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the umrareterms kind.
    • isUmsigterms

      public boolean isUmsigterms()
      Is this variant instance of kind umsigterms?
    • umsigterms

      public UnmappedSignificantTermsAggregate umsigterms()
      Get the umsigterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the umsigterms kind.
    • isUmterms

      public boolean isUmterms()
      Is this variant instance of kind umterms?
    • umterms

      public UnmappedTermsAggregate umterms()
      Get the umterms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the umterms kind.
    • isValueCount

      public boolean isValueCount()
      Is this variant instance of kind value_count?
    • valueCount

      public ValueCountAggregate valueCount()
      Get the value_count variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the value_count kind.
    • isVariableWidthHistogram

      public boolean isVariableWidthHistogram()
      Is this variant instance of kind variable_width_histogram?
    • variableWidthHistogram

      public VariableWidthHistogramAggregate variableWidthHistogram()
      Get the variable_width_histogram variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the variable_width_histogram kind.
    • isWeightedAvg

      public boolean isWeightedAvg()
      Is this variant instance of kind weighted_avg?
    • weightedAvg

      public WeightedAvgAggregate weightedAvg()
      Get the weighted_avg variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the weighted_avg kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable