Interface Out<O>

Type Parameters:
O - the type of the output destination

public interface Out<O>
An interface for writing and encoding data to various destinations.

This interface provides methods to write primitive types, strings, lists, and maps to an underlying data destination. All methods return a Result that either contains the successfully encoded value or an EncodeError if the operation failed.

  • Method Details

    • writeBoolean

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeBoolean(boolean value)
      Writes a Boolean value to the output destination.
      Parameters:
      value - the Boolean value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • writeByte

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeByte(byte value)
      Writes a Byte value to the output destination.
      Parameters:
      value - the Byte value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • writeChar

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeChar(char value)
      Writes a Character value to the output destination.
      Parameters:
      value - the Character value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • writeDouble

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeDouble(double value)
      Writes a Double value to the output destination.
      Parameters:
      value - the Double value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • writeFloat

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeFloat(float value)
      Writes a Float value to the output destination.
      Parameters:
      value - the Float value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • writeInt

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeInt(int value)
      Writes an Integer value to the output destination.
      Parameters:
      value - the Integer value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • writeLong

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeLong(long value)
      Writes a Long value to the output destination.
      Parameters:
      value - the Long value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • writeShort

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeShort(short value)
      Writes a Short value to the output destination.
      Parameters:
      value - the Short value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • writeString

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> writeString(@NotNull @NotNull String value)
      Writes a String value to the output destination.
      Parameters:
      value - the String value to write
      Returns:
      a result containing the output destination, or an EncodeError if the operation failed
    • createList

      @NotNull @NotNull dev.siroshun.jfun.result.Result<ElementAppender<O>,EncodeError> createList()
      Creates a new list in the output destination.
      Returns:
      a result containing an ElementAppender for adding elements to the list, or an EncodeError if the operation failed
    • createMap

      @NotNull @NotNull dev.siroshun.jfun.result.Result<EntryAppender<O>,EncodeError> createMap()
      Creates a new map in the output destination.
      Returns:
      a result containing an EntryAppender for adding key-value pairs to the map,or an EncodeError if the operation failed