Class DefaultViewResult

java.lang.Object
com.couchbase.client.java.view.DefaultViewResult
All Implemented Interfaces:
ViewResult, Iterable<ViewRow>

public class DefaultViewResult
extends Object
implements ViewResult
  • Constructor Details

  • Method Details

    • allRows

      public List<ViewRow> allRows()
      Description copied from interface: ViewResult
      Collects all rows received from the view with the default view timeout. This method throws: - TimeoutException wrapped in a RuntimeException: If the timeout is exceeded.
      Specified by:
      allRows in interface ViewResult
      Returns:
      a (potentially empty) List containing view rows.
    • allRows

      public List<ViewRow> allRows​(long timeout, TimeUnit timeUnit)
      Description copied from interface: ViewResult
      Collects all rows received from the view with the default view timeout. This method throws: - TimeoutException wrapped in a RuntimeException: If the timeout is exceeded.
      Specified by:
      allRows in interface ViewResult
      Returns:
      a (potentially empty) List containing view rows.
    • rows

      public Iterator<ViewRow> rows()
      Description copied from interface: ViewResult
      Emits one ViewRow for each row received from the view with the default view timeout. This method throws: - TimeoutException wrapped in a RuntimeException: If the timeout is exceeded.
      Specified by:
      rows in interface ViewResult
      Returns:
      a (potentially empty) Iterator containing view rows.
    • rows

      public Iterator<ViewRow> rows​(long timeout, TimeUnit timeUnit)
      Description copied from interface: ViewResult
      Emits one ViewRow for each row received from the view with a custom timeout. This method throws: - TimeoutException wrapped in a RuntimeException: If the timeout is exceeded.
      Specified by:
      rows in interface ViewResult
      Parameters:
      timeout - the custom timeout.
      timeUnit - the time unit for the custom timeout.
      Returns:
      a (potentially empty) Iterator containing view rows.
    • iterator

      public Iterator<ViewRow> iterator()
      Specified by:
      iterator in interface Iterable<ViewRow>
    • totalRows

      public int totalRows()
      Description copied from interface: ViewResult
      The total number of rows.
      Specified by:
      totalRows in interface ViewResult
      Returns:
      number of rows.
    • success

      public boolean success()
      Description copied from interface: ViewResult
      If the query was successful.
      Specified by:
      success in interface ViewResult
      Returns:
      true if it was, false otherwise.
    • error

      public JsonObject error()
      Description copied from interface: ViewResult
      If it was not successful, an error is contained here.
      Specified by:
      error in interface ViewResult
      Returns:
      the potential error.
    • error

      public JsonObject error​(long timeout, TimeUnit timeUnit)
      Description copied from interface: ViewResult
      If it was not successful, an error is contained here.
      Specified by:
      error in interface ViewResult
      Returns:
      the potential error.
    • debug

      public JsonObject debug()
      Description copied from interface: ViewResult
      If debug was enabled on the query, it is contained here.
      Specified by:
      debug in interface ViewResult
      Returns:
      the debug info.