Interface EntityWriter<T>

Type Parameters:
T - type of entity

public interface EntityWriter<T>
Writer of entity into bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    instanceWriter(io.helidon.common.GenericType<T> type, T object, Headers requestHeaders, WritableHeaders<?> responseHeaders)
    Server response entity instance writer.
    instanceWriter(io.helidon.common.GenericType<T> type, T object, WritableHeaders<?> requestHeaders)
    Client request entity instance writer.
    default boolean
    Whether this entity writer can provide more information about each entity instance, such as content length.
    void
    write(io.helidon.common.GenericType<T> type, T object, OutputStream outputStream, Headers requestHeaders, WritableHeaders<?> responseHeaders)
    Write server response entity and close the stream.
    void
    write(io.helidon.common.GenericType<T> type, T object, OutputStream outputStream, WritableHeaders<?> headers)
    Write client request entity and close the stream.
  • Method Details

    • supportsInstanceWriter

      default boolean supportsInstanceWriter()
      Whether this entity writer can provide more information about each entity instance, such as content length.
      Returns:
      whether instanceWriter methods are supported; If not one of the write methods would be called instead
    • instanceWriter

      default InstanceWriter instanceWriter(io.helidon.common.GenericType<T> type, T object, WritableHeaders<?> requestHeaders)
      Client request entity instance writer.
      Parameters:
      type - type of entity
      object - object to write
      requestHeaders - request headers
      Returns:
      instance writer ready to write the provided entity
    • instanceWriter

      default InstanceWriter instanceWriter(io.helidon.common.GenericType<T> type, T object, Headers requestHeaders, WritableHeaders<?> responseHeaders)
      Server response entity instance writer.
      Parameters:
      type - type of entity
      object - object to write
      requestHeaders - request headers
      responseHeaders - response headers
      Returns:
      instance writer ready to write the provided entity
    • write

      void write(io.helidon.common.GenericType<T> type, T object, OutputStream outputStream, Headers requestHeaders, WritableHeaders<?> responseHeaders)
      Write server response entity and close the stream.
      Parameters:
      type - type of entity
      object - object to write
      outputStream - output stream to write to
      requestHeaders - request headers
      responseHeaders - response headers
    • write

      void write(io.helidon.common.GenericType<T> type, T object, OutputStream outputStream, WritableHeaders<?> headers)
      Write client request entity and close the stream.
      Parameters:
      type - type of entity
      object - object to write
      outputStream - output stream to write to
      headers - request headers