Package dev.siroshun.codec4j.api.io
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 TypeMethodDescription@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> finish()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
nullif the operation succeeded, or aEncodeErrorif the operation failed
-
finish
Finishes writing elements to the output destination.- Returns:
- a result containing
nullif the operation succeeded, or aEncodeErrorif the operation failed
-