Interface ViewRow

All Known Implementing Classes:
DefaultViewRow

@Committed
@Public
public interface ViewRow
Represents a ViewRow fetched from the View.
Since:
2.0
Author:
Michael Nitschinger
  • Method Summary

    Modifier and Type Method Description
    JsonDocument document()
    Load the underlying document, if not reduced with the default view timeout.
    JsonDocument document​(long timeout, TimeUnit timeUnit)
    Load the underlying document, if not reduced with a custom timeout.
    <D extends Document<?>>
    D
    document​(Class<D> target)
    Load the underlying document, if not reduced with the default view timeout.
    <D extends Document<?>>
    D
    document​(Class<D> target, long timeout, TimeUnit timeUnit)
    Load the underlying document, if not reduced with a custom timeout.
    String id()
    The id of the document, if not reduced.
    Object key()
    The key of the row index.
    Object value()
    The value of the row index.
  • Method Details

    • id

      String id()
      The id of the document, if not reduced.
      Returns:
      the id of the document.
    • key

      Object key()
      The key of the row index. The object can be any valid JSON object, including JsonArray or JsonObject.
      Returns:
      the key.
    • value

      Object value()
      The value of the row index. The object can be any valid JSON object, including JsonArray or JsonObject.
      Returns:
      the value.
    • document

      JsonDocument document()
      Load the underlying document, if not reduced with the default view timeout. This method throws: - TimeoutException wrapped in a RuntimeException: If the timeout is exceeded. - BackpressureException: If the incoming request rate is too high to be processed. - IllegalStateException: If the view is reduced and the ID is null. - TranscodingException: If the response document could not be decoded.
      Returns:
      the loaded document, null if not found.
    • document

      JsonDocument document​(long timeout, TimeUnit timeUnit)
      Load the underlying document, if not reduced with a custom timeout. This method throws: - TimeoutException wrapped in a RuntimeException: If the timeout is exceeded. - BackpressureException: If the incoming request rate is too high to be processed. - IllegalStateException: If the view is reduced and the ID is null. - TranscodingException: If the response document could not be decoded.
      Parameters:
      timeout - the custom timeout.
      timeUnit - the time unit for the custom timeout.
      Returns:
      the loaded document, null if not found.
    • document

      <D extends Document<?>> D document​(Class<D> target)
      Load the underlying document, if not reduced with the default view timeout. This method throws: - TimeoutException wrapped in a RuntimeException: If the timeout is exceeded. - BackpressureException: If the incoming request rate is too high to be processed. - IllegalStateException: If the view is reduced and the ID is null. - TranscodingException: If the response document could not be decoded.
      Parameters:
      target - the custom target document type.
      Returns:
      the loaded document, null if not found.
    • document

      <D extends Document<?>> D document​(Class<D> target, long timeout, TimeUnit timeUnit)
      Load the underlying document, if not reduced with a custom timeout. This method throws: - TimeoutException wrapped in a RuntimeException: If the timeout is exceeded. - BackpressureException: If the incoming request rate is too high to be processed. - IllegalStateException: If the view is reduced and the ID is null. - TranscodingException: If the response document could not be decoded.
      Parameters:
      target - the custom target document type.
      timeout - the custom timeout.
      timeUnit - the time unit for the custom timeout.
      Returns:
      the loaded document, null if not found.