Package com.stardog.stark.query.io

# Class QueryResultWriters

java.lang.Object
com.stardog.stark.query.io.QueryResultWriters

public final class QueryResultWriters extends Object

Utilities for `writing` `query results`.

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Optional<BooleanQueryResultWriter>`
  `to(QueryResultFormat theFormat, OutputStream theOutputStream, Options theOptions)`
  `static Optional<QueryResultWriter<BindingSet>>`
  `to(OutputStream theOutput, QueryResultFormat theFormat)`
  Create a new `writer` to write in the specified `format` with the `default options`.
  `static Optional<QueryResultWriter<BindingSet>>`
  `to(OutputStream theOutput, QueryResultFormat theFormat, Options theOptions)`
  Create a new `writer` to write in the specified `format` with the `default options`.
  `static void`
  `write(BooleanQueryResult theResult, OutputStream theOutput, QueryResultFormat theQueryResultFormat)`
  `static void`
  `write(BooleanQueryResult theResult, Path thePath, QueryResultFormat theQueryResultFormat)`
  `static void`
  `write(QueryResult theResult, Path thePath, QueryResultFormat theQueryResultFormat)`
  `static void`
  `write(SelectQueryResult theResult, SelectQueryResultWriter theWriter)`
  `static void`
  `write(SelectQueryResult theResult, OutputStream theOutput, QueryResultFormat theQueryResultFormat)`
  `static void`
  `write(SelectQueryResult theResult, Path thePath, QueryResultFormat theQueryResultFormat)`

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

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

- ## Method Details

  - ### write

    public static void write(@Nonnull QueryResult theResult, @Nonnull Path thePath, @Nonnull QueryResultFormat theQueryResultFormat) throws IOException, ResultWritingFailed
    Throws:
      `IOException`
      `ResultWritingFailed`
    Implementation Notes:
      The result set is closed as a side effect of this call

  - ### write

    public static void write(@Nonnull BooleanQueryResult theResult, @Nonnull Path thePath, @Nonnull QueryResultFormat theQueryResultFormat) throws IOException, ResultWritingFailed
    Throws:
      `IOException`
      `ResultWritingFailed`
    Implementation Notes:
      The result set is closed as a side effect of this call

  - ### write

    public static void write(@Nonnull BooleanQueryResult theResult, @Nonnull OutputStream theOutput, @Nonnull QueryResultFormat theQueryResultFormat) throws IOException, ResultWritingFailed
    Throws:
      `IOException`
      `ResultWritingFailed`
    Implementation Notes:
      The result set is closed as a side effect of this call

  - ### write

    public static void write(@Nonnull SelectQueryResult theResult, @Nonnull Path thePath, @Nonnull QueryResultFormat theQueryResultFormat) throws IOException, ResultWritingFailed
    Throws:
      `IOException`
      `ResultWritingFailed`
    Implementation Notes:
      The result set is closed as a side effect of this call

  - ### write

    public static void write(@Nonnull SelectQueryResult theResult, @Nonnull OutputStream theOutput, @Nonnull QueryResultFormat theQueryResultFormat) throws IOException, ResultWritingFailed
    Throws:
      `IOException`
      `ResultWritingFailed`
    Implementation Notes:
      The result set is closed as a side effect of this call

  - ### write

    public static void write(@Nonnull SelectQueryResult theResult, @Nonnull SelectQueryResultWriter theWriter) throws ResultWritingFailed
    Throws:
      `ResultWritingFailed`
    Implementation Notes:
      The result set is closed as a side effect of this call

  - ### to

    public static Optional<QueryResultWriter<BindingSet>> to(@Nonnull OutputStream theOutput, @Nonnull QueryResultFormat theFormat)
    Create a new `writer` to write in the specified `format` with the `default options`.
    Parameters:
      `theOutput` - the output to write to
      `theFormat` - the format to write in
    Returns:
      the `QueryResultWriter` to use for writing
    See Also:
      - `QueryResultWriterOptions`
    Implementation Notes:
      The `OutputStream` is *not* closed when writing is complete

  - ### to

    public static Optional<BooleanQueryResultWriter> to(@Nonnull QueryResultFormat theFormat, @Nonnull OutputStream theOutputStream, @Nonnull Options theOptions)

  - ### to

    public static Optional<QueryResultWriter<BindingSet>> to(@Nonnull OutputStream theOutput, @Nonnull QueryResultFormat theFormat, @Nonnull Options theOptions)
    Create a new `writer` to write in the specified `format` with the `default options`.
    Parameters:
      `theOutput` - the output to write to
      `theFormat` - the format to write in
    Returns:
      the `QueryResultWriter` to use for writing
    See Also:
      - `QueryResultWriterOptions`
    Implementation Notes:
      The `OutputStream` is *not* closed when writing is complete