Class QueryPage<T extends org.elasticsearch.xcontent.ToXContent & Writeable>

java.lang.Object
org.elasticsearch.xpack.core.action.util.QueryPage<T>
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public final class QueryPage<T extends org.elasticsearch.xcontent.ToXContent & Writeable> extends Object implements org.elasticsearch.xcontent.ToXContentObject, Writeable
Generic wrapper class for a page of query results and the total number of query results.
count() is the total number of results but that value may not be equal to the actual length of the results() list if from & take or some cursor was used in the database query.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent

    org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.elasticsearch.xcontent.ParseField
     
    static final org.elasticsearch.xcontent.ParseField
     

    Fields inherited from interface org.elasticsearch.xcontent.ToXContent

    EMPTY, EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    QueryPage(List<T> results, long count, org.elasticsearch.xcontent.ParseField resultsField)
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    org.elasticsearch.xcontent.XContentBuilder
    doXContentBody(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params)
     
    emptyQueryPage(org.elasticsearch.xcontent.ParseField resultsField)
     
    boolean
     
    org.elasticsearch.xcontent.ParseField
     
    int
     
     
    org.elasticsearch.xcontent.XContentBuilder
    toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params)
     
    void
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject

    isFragment
  • Field Details

    • COUNT

      public static final org.elasticsearch.xcontent.ParseField COUNT
    • DEFAULT_RESULTS_FIELD

      public static final org.elasticsearch.xcontent.ParseField DEFAULT_RESULTS_FIELD
  • Constructor Details

  • Method Details

    • emptyQueryPage

      public static ResourceNotFoundException emptyQueryPage(org.elasticsearch.xcontent.ParseField resultsField)
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • doXContentBody

      public org.elasticsearch.xcontent.XContentBuilder doXContentBody(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Throws:
      IOException
    • results

      public List<T> results()
    • count

      public long count()
    • getResultsField

      public org.elasticsearch.xcontent.ParseField getResultsField()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object