Package org.eclipse.rdf4j.query.impl

## Class TupleQueryResultBuilder

- java.lang.Object
- - org.eclipse.rdf4j.query.AbstractTupleQueryResultHandler
  - - org.eclipse.rdf4j.query.impl.TupleQueryResultBuilder

- All Implemented Interfaces:
    `QueryResultHandler`, `TupleQueryResultHandler`

      public class TupleQueryResultBuilder
      extends AbstractTupleQueryResultHandler

  A TupleQueryResultHandler that can be used to create a TupleQueryResult object.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TupleQueryResultBuilder()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `TupleQueryResult` | `getQueryResult()` |
    `void` | `handleSolution​(BindingSet bindingSet)` | Handles a solution.
    `void` | `startQueryResult​(List<String> bindingNames)` | Indicates the start of a sequence of Solutions.

    - ### Methods inherited from class org.eclipse.rdf4j.query.AbstractTupleQueryResultHandler

      `endQueryResult, handleBoolean, handleLinks`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TupleQueryResultBuilder

          public TupleQueryResultBuilder()

  - ### Method Detail

    - #### startQueryResult

          public void startQueryResult​(List<String> bindingNames)
                                throws TupleQueryResultHandlerException

      Description copied from interface: `QueryResultHandler`
      Indicates the start of a sequence of Solutions. The supplied bindingNames are an indication of the values that are in the Solutions. For example, a SPARQL query like select ?X ?Y where { ?X ?P ?Y } will have binding names X and Y.
      Specified by:
        `startQueryResult` in interface `QueryResultHandler`
      Overrides:
        `startQueryResult` in class `AbstractTupleQueryResultHandler`
      Parameters:
        `bindingNames` - An ordered set of binding names.
      Throws:
        `TupleQueryResultHandlerException` - If there was an error during the starting of the query result handler. This exception may be thrown if the `QueryResultHandler.handleBoolean(boolean)` method was called before this method and the handler cannot process both boolean and tuple results simultaneously.

    - #### handleSolution

          public void handleSolution​(BindingSet bindingSet)
                              throws TupleQueryResultHandlerException

      Description copied from interface: `QueryResultHandler`
      Handles a solution.
      Specified by:
        `handleSolution` in interface `QueryResultHandler`
      Overrides:
        `handleSolution` in class `AbstractTupleQueryResultHandler`
      Parameters:
        `bindingSet` - A single set of tuple results, with binding names bound to values. Each of the binding names in the solution must have previously been registered with the `QueryResultHandler.startQueryResult(List)` method.
      Throws:
        `TupleQueryResultHandlerException` - If there was an error during the handling of the query solution. This exception may be thrown if the `QueryResultHandler.handleBoolean(boolean)` method was called before this method and the handler cannot process both boolean and tuple results simultaneously.

    - #### getQueryResult

          public TupleQueryResult getQueryResult()