Class InternalRange.Bucket

java.lang.Object
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation.InternalBucket
org.elasticsearch.search.aggregations.bucket.range.InternalRange.Bucket
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, MultiBucketsAggregation.Bucket, Range.Bucket, HasAggregations
Direct Known Subclasses:
InternalDateRange.Bucket
Enclosing class:
InternalRange<B extends InternalRange.Bucket,​R extends InternalRange<B,​R>>

public static class InternalRange.Bucket
extends InternalMultiBucketAggregation.InternalBucket
implements Range.Bucket
  • Field Details

    • keyed

      protected final transient boolean keyed
    • format

      protected final transient DocValueFormat format
    • from

      protected final double from
    • to

      protected final double to
  • Constructor Details

  • Method Details

    • getKey

      public java.lang.String getKey()
      Specified by:
      getKey in interface MultiBucketsAggregation.Bucket
      Returns:
      The key associated with the bucket
    • getKeyAsString

      public java.lang.String getKeyAsString()
      Specified by:
      getKeyAsString in interface MultiBucketsAggregation.Bucket
      Returns:
      The key associated with the bucket as a string
    • getFrom

      public java.lang.Object getFrom()
      Specified by:
      getFrom in interface Range.Bucket
      Returns:
      The lower bound of the range
    • getTo

      public java.lang.Object getTo()
      Specified by:
      getTo in interface Range.Bucket
      Returns:
      The upper bound of the range (excluding)
    • getKeyed

      public boolean getKeyed()
    • getFormat

      public DocValueFormat getFormat()
    • getFromAsString

      public java.lang.String getFromAsString()
      Specified by:
      getFromAsString in interface Range.Bucket
      Returns:
      The string value for the lower bound of the range
    • getToAsString

      public java.lang.String getToAsString()
      Specified by:
      getToAsString in interface Range.Bucket
      Returns:
      The string value for the upper bound of the range (excluding)
    • getDocCount

      public long getDocCount()
      Specified by:
      getDocCount in interface MultiBucketsAggregation.Bucket
      Returns:
      The number of documents that fall within this bucket
    • getAggregations

      public InternalAggregations getAggregations()
      Specified by:
      getAggregations in interface HasAggregations
      Specified by:
      getAggregations in interface MultiBucketsAggregation.Bucket
      Returns:
      The sub-aggregations of this bucket
    • getFactory

      protected InternalRange.Factory<? extends InternalRange.Bucket,​?> getFactory()
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException
    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      java.io.IOException
    • equals

      public boolean equals​(java.lang.Object other)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object