Interface EntryAppender<O>

Type Parameters:
O - the type of the output destination

public interface EntryAppender<O>
An interface for writing key-value to an Out.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull dev.siroshun.jfun.result.Result<Void,EncodeError>
    append(@NotNull Function<@NotNull Out<O>,@NotNull dev.siroshun.jfun.result.Result<O,EncodeError>> keyWriter, @NotNull Function<@NotNull Out<O>,@NotNull dev.siroshun.jfun.result.Result<O,EncodeError>> valueWriter)
    Appends a key-value pair to the output destination.
    @NotNull dev.siroshun.jfun.result.Result<O,EncodeError>
    Finishes writing key-value pairs to the output destination.
  • Method Details

    • append

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Void,EncodeError> append(@NotNull @NotNull Function<@NotNull Out<O>,@NotNull dev.siroshun.jfun.result.Result<O,EncodeError>> keyWriter, @NotNull @NotNull Function<@NotNull Out<O>,@NotNull dev.siroshun.jfun.result.Result<O,EncodeError>> valueWriter)
      Appends a key-value pair to the output destination.
      Parameters:
      keyWriter - the function to write the key
      valueWriter - the function to write the value
      Returns:
      a result containing null if the operation succeeded, or a EncodeError if the operation failed
    • finish

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> finish()
      Finishes writing key-value pairs to the output destination.
      Returns:
      a result containing null if the operation succeeded, or a EncodeError if the operation failed