Class AbstractPageCallback<T,R>

java.lang.Object
com.atlassian.diagnostics.AbstractPageCallback<T,R>
Type Parameters:
T - the type of the value to return at the end of streaming
All Implemented Interfaces:
PageCallback<T,R>

public abstract class AbstractPageCallback<T,R> extends Object implements PageCallback<T,R>
A convenience base class for a streaming callback that returns some possibly null value of type T at the end of streaming and does no initialisation itself of this value before the first item.
  • Field Details

    • value

      protected R value
  • Constructor Details

    • AbstractPageCallback

      protected AbstractPageCallback(R value)
  • Method Details

    • onStart

      public void onStart(@Nonnull PageRequest pageRequest)
      Description copied from interface: PageCallback
      Called before the first item is encountered. Note that this will be called even if no item is passed to this callback (for instance if any associated criteria with the streaming operation failed to find matching items).
      Specified by:
      onStart in interface PageCallback<T,R>
    • onEnd

      public R onEnd(@Nonnull PageSummary summary)
      Description copied from interface: PageCallback
      Called after the last item has been passed to this callback (or if no item are to be passed then immediately after PageCallback.onStart(PageRequest).
      Specified by:
      onEnd in interface PageCallback<T,R>
      Returns:
      any result the callback wishes the enclosing call or process to return to its caller or null if no such result is to be supplied (or if the result is in fact null)