Package nbbrd.io
Interface FileFormatter<T>
public interface FileFormatter<T>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <V> @NonNull FileFormatter<V> compose(@NonNull IOFunction<? super V, ? extends T> before) default voidformatFile(T value, @NonNull File target) default voidformatPath(T value, @NonNull Path target) voidformatStream(T value, @NonNull OutputStream resource) default voidformatStream(T value, @NonNull IOSupplier<? extends OutputStream> target) static <T> @NonNull FileFormatter<T> onFormattingEncoder(@NonNull FileFormatter<T> formatter, @NonNull IOFunction<OutputStream, ? extends FilterOutputStream> encoder) static <T> @NonNull FileFormatter<T> onFormattingGzip(@NonNull FileFormatter<T> formatter) Deprecated.static <T> @NonNull FileFormatter<T> onFormattingLock(@NonNull FileFormatter<T> formatter) static <T> @NonNull FileFormatter<T> onFormattingStream(@NonNull IOBiConsumer<? super T, ? super OutputStream> function)
-
Method Details
-
formatFile
- Throws:
IOException
-
formatPath
- Throws:
IOException
-
formatStream
default void formatStream(@NonNull T value, @NonNull @NonNull IOSupplier<? extends OutputStream> target) throws IOException - Throws:
IOException
-
formatStream
- Throws:
IOException
-
compose
@NonNull default <V> @NonNull FileFormatter<V> compose(@NonNull @NonNull IOFunction<? super V, ? extends T> before) -
onFormattingStream
@NonNull static <T> @NonNull FileFormatter<T> onFormattingStream(@NonNull @NonNull IOBiConsumer<? super T, ? super OutputStream> function) -
onFormattingGzip
@Deprecated @NonNull static <T> @NonNull FileFormatter<T> onFormattingGzip(@NonNull @NonNull FileFormatter<T> formatter) Deprecated.UseonFormattingEncoder(FileFormatter, IOFunction)instead- Type Parameters:
T- the type of the formatted object- Parameters:
formatter- the formatter to be wrapped- Returns:
- a non-null
FileFormatterthat formats a GZIP compressed file
-
onFormattingEncoder
@NonNull static <T> @NonNull FileFormatter<T> onFormattingEncoder(@NonNull @NonNull FileFormatter<T> formatter, @NonNull @NonNull IOFunction<OutputStream, ? extends FilterOutputStream> encoder) -
onFormattingLock
@NonNull static <T> @NonNull FileFormatter<T> onFormattingLock(@NonNull @NonNull FileFormatter<T> formatter)
-
onFormattingEncoder(FileFormatter, IOFunction)instead