Interface ElementAppender<O>

Type Parameters:
O - the type of the output destination

public interface ElementAppender<O>
An interface for writing elements to an Out.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull dev.siroshun.jfun.result.Result<O,EncodeError>
    append(@NotNull Function<@NotNull Out<O>,@NotNull dev.siroshun.jfun.result.Result<O,EncodeError>> function)
    Appends an element to the output destination.
    @NotNull dev.siroshun.jfun.result.Result<O,EncodeError>
    Finishes writing elements to the output destination.
  • Method Details

    • append

      @NotNull @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> append(@NotNull @NotNull Function<@NotNull Out<O>,@NotNull dev.siroshun.jfun.result.Result<O,EncodeError>> function)
      Appends an element to the output destination.
      Parameters:
      function - the function to write the element
      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 elements to the output destination.
      Returns:
      a result containing null if the operation succeeded, or a EncodeError if the operation failed