Class AbstractCompositeByteBufTemplateSet

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

public abstract class AbstractCompositeByteBufTemplateSet extends AbstractTemplateSet implements ByteBufTemplateSet

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

Since:
1.2
Author:
Jeremy Kuhn
  • Constructor Details

    • AbstractCompositeByteBufTemplateSet

      public AbstractCompositeByteBufTemplateSet(Charset charset)

      Creates a composite ByteBuf template set.

      Parameters:
      charset - the charset to use to encode data
  • Method Details

    • getOutput

      public ByteBuf getOutput()

      Returns the composite 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