T
- Type of CodegenWriter
to create.@FunctionalInterface
@Deprecated
public interface CodegenWriterFactory<T extends CodegenWriter<T,?>>
extends java.util.function.BiFunction<java.lang.String,java.lang.String,T>
Factory used to create a CodegenWriter
.
The following example shows how to implement a basic
CodegenWriterFactory
.
public final class MyWriterFactory implements CodegenWriterFactory<MyWriter> {
\@Override
public MyWriter apply(String filename, String namespace) {
return new MyWriter(namespace);
}
}
Because CodegenWriterFactory
is a FunctionalInterface
,
it can be implemented using a lambda expression:
CodegenWriterFactory<MyWriter> = (filename, namespace) -> new MyWriter(namespace);
Modifier and Type | Method and Description |
---|---|
T |
apply(java.lang.String filename,
java.lang.String namespace)
Deprecated.
Creates a
CodegenWriter of type T for the given
filename and namespace. |
T apply(java.lang.String filename, java.lang.String namespace)
CodegenWriter
of type T
for the given
filename and namespace.apply
in interface java.util.function.BiFunction<java.lang.String,java.lang.String,T extends CodegenWriter<T,?>>
filename
- Non-null filename of the writer being created.namespace
- Non-null namespace associated with the file (possibly empty string).T
.