Class LongTerms.Bucket

All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, MultiBucketsAggregation.Bucket, Terms.Bucket, HasAggregations, KeyComparable<LongTerms.Bucket>
Enclosing class:
LongTerms

public static class LongTerms.Bucket
extends InternalTerms.Bucket<LongTerms.Bucket>
  • Constructor Details

    • Bucket

      public Bucket​(long term, long docCount, InternalAggregations aggregations, boolean showDocCountError, long docCountError, DocValueFormat format)
    • Bucket

      public Bucket​(StreamInput in, DocValueFormat format, boolean showDocCountError) throws java.io.IOException
      Read from a stream.
      Throws:
      java.io.IOException
  • Method Details

    • writeTermTo

      protected void writeTermTo​(StreamOutput out) throws java.io.IOException
      Specified by:
      writeTermTo in class InternalTerms.Bucket<LongTerms.Bucket>
      Throws:
      java.io.IOException
    • getKeyAsString

      public java.lang.String getKeyAsString()
      Returns:
      The key associated with the bucket as a string
    • getKey

      public java.lang.Object getKey()
      Returns:
      The key associated with the bucket
    • getKeyAsNumber

      public java.lang.Number getKeyAsNumber()
    • compareKey

      public int compareKey​(LongTerms.Bucket other)
      Description copied from interface: KeyComparable
      Compare this MultiBucketsAggregation.Buckets key with another bucket.
      Parameters:
      other - the bucket that contains the key to compare to.
      Returns:
      a negative integer, zero, or a positive integer as this buckets key is less than, equal to, or greater than the other buckets key.
      See Also:
      Comparable.compareTo(Object)
    • keyToXContent

      protected final org.elasticsearch.common.xcontent.XContentBuilder keyToXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder) throws java.io.IOException
      Specified by:
      keyToXContent in class InternalTerms.Bucket<LongTerms.Bucket>
      Throws:
      java.io.IOException
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class InternalTerms.Bucket<LongTerms.Bucket>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class InternalTerms.Bucket<LongTerms.Bucket>