Class AbstractByteBufTemplateSet

java.lang.Object
io.inverno.mod.irt.AbstractTemplateSet
io.inverno.mod.irt.AbstractByteBufTemplateSet
All Implemented Interfaces:
ByteBufTemplateSet, TemplateSet

public abstract class AbstractByteBufTemplateSet extends AbstractTemplateSet implements ByteBufTemplateSet

A TemplateSet base implementation template sets which renders data in a ByteBuf.

Since:
1.2
Author:
Jeremy Kuhn
  • Constructor Details

    • AbstractByteBufTemplateSet

      public AbstractByteBufTemplateSet(Charset charset, ByteBuf buffer)

      Creates a ByteBuf template set.

      Parameters:
      charset - the charset to use to encode data
      buffer - the buffer into which data must be rendered
  • Method Details

    • getOutput

      public ByteBuf getOutput()

      Returns the ByteBuffer containing the rendered data.

      Returns:
      a ByteBuffer
    • render

      public CompletableFuture<Void> render(Object value)
      Description copied from interface: TemplateSet

      Renders an object to the output.

      This method might invoke specialized methods based on the actual type of the object. If no specific method is found the string representation of the object must be rendered.

      Specified by:
      render in interface TemplateSet
      Overrides:
      render in class AbstractTemplateSet
      Parameters:
      value - the object to render
      Returns:
      a future which completes once the value is rendered
    • render

      public CompletableFuture<Void> render(ByteBuf value)
      Description copied from interface: ByteBufTemplateSet

      Renders a ByteBuf to the output.

      Specified by:
      render in interface ByteBufTemplateSet
      Parameters:
      value - the ByteBuf to render
      Returns:
      a future which completes once the value is rendered
    • render

      public CompletableFuture<Void> render(String value)
      Description copied from interface: TemplateSet

      Renders a string to the output.

      Specified by:
      render in interface TemplateSet
      Parameters:
      value - the string to render
      Returns:
      a future which completes once the value is rendered
    • render

      public CompletableFuture<Void> render(byte[] value)
      Description copied from interface: TemplateSet

      Renders a byte array to the output.

      Specified by:
      render in interface TemplateSet
      Parameters:
      value - The byte array to render
      Returns:
      a future which completes once the value is rendered