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