Package nbbrd.io.text
Interface TextFormatter<T>
public interface TextFormatter<T>
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NonNull FileFormatter<T> asFileFormatter(@NonNull Charset encoding) asFormatter(@NonNull Consumer<? super Throwable> onError) default <V> @NonNull TextFormatter<V> compose(@NonNull IOFunction<? super V, ? extends T> before) default voidformatChars(T value, @NonNull Appendable target) default voidformatFile(T value, @NonNull File target, @NonNull Charset encoding) default voidformatPath(T value, @NonNull Path target, @NonNull Charset encoding) voidformatStream(T value, @NonNull OutputStream resource, @NonNull Charset encoding) default voidformatStream(T value, @NonNull IOSupplier<? extends OutputStream> target, @NonNull Charset encoding) default @NonNull StringformatToString(T value) voidformatWriter(T value, @NonNull Writer resource) default voidformatWriter(T value, @NonNull IOSupplier<? extends Writer> target) static <T> @NonNull TextFormatter<T> onFormattingWriter(@NonNull IOBiConsumer<? super T, ? super Writer> function)
-
Method Details
-
formatToString
- Throws:
IOException
-
formatChars
- Throws:
IOException
-
formatFile
default void formatFile(@NonNull T value, @NonNull @NonNull File target, @NonNull @NonNull Charset encoding) throws IOException - Throws:
IOException
-
formatPath
default void formatPath(@NonNull T value, @NonNull @NonNull Path target, @NonNull @NonNull Charset encoding) throws IOException - Throws:
IOException
-
formatWriter
default void formatWriter(@NonNull T value, @NonNull @NonNull IOSupplier<? extends Writer> target) throws IOException - Throws:
IOException
-
formatStream
default void formatStream(@NonNull T value, @NonNull @NonNull IOSupplier<? extends OutputStream> target, @NonNull @NonNull Charset encoding) throws IOException - Throws:
IOException
-
formatWriter
- Throws:
IOException
-
formatStream
void formatStream(@NonNull T value, @NonNull @NonNull OutputStream resource, @NonNull @NonNull Charset encoding) throws IOException - Throws:
IOException
-
compose
@NonNull default <V> @NonNull TextFormatter<V> compose(@NonNull @NonNull IOFunction<? super V, ? extends T> before) -
asFileFormatter
-
asFormatter
-
asFormatter
-
onFormattingWriter
@NonNull static <T> @NonNull TextFormatter<T> onFormattingWriter(@NonNull @NonNull IOBiConsumer<? super T, ? super Writer> function)
-