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