public final class Consumers
extends java.lang.Object
Consumer
s of type String
and can be used with this Decompiler API.Modifier and Type | Method and Description |
---|---|
static java.util.function.Consumer<java.lang.String> |
file(java.io.File file)
Returns a
Consumer that will write the source code to the file represented by file . |
static java.util.function.Consumer<java.lang.String> |
file(java.lang.String fileName)
Returns a
Consumer that will write the source code to the file represented by the filename given by fileName . |
public static java.util.function.Consumer<java.lang.String> file(java.io.File file)
Consumer
that will write the source code to the file represented by file
.
If file
is null
, a NullPointerException
will be thrown.
If an I/O-error occurs while writing to the file, an UncheckedIOException
will be thrown.
file
- a File
denoting the file to write the source code toConsumer
that will write the source code to the file represented by file
java.lang.NullPointerException
- thrown if, and only if, file
is null
java.io.UncheckedIOException
- thrown if, and only if, an I/O-error occurs while writing to the filepublic static java.util.function.Consumer<java.lang.String> file(java.lang.String fileName)
Consumer
that will write the source code to the file represented by the filename given by fileName
.
Calling this method is equivalent to calling Consumers.file(new File(fileName))
, assuming that fileName
is not null
.
If fileName
is null
, a NullPointerException
will be thrown.
If an I/O-error occurs while writing to the file, an UncheckedIOException
will be thrown.
fileName
- the filename of the file to write the source code toConsumer
that will write the source code to the file represented by the filename given by fileName
java.lang.NullPointerException
- thrown if, and only if, fileName
is null
java.io.UncheckedIOException
- thrown if, and only if, an I/O-error occurs while writing to the file