Interface CodegenWriterFactory<T extends CodegenWriter<T,?>>
- Type Parameters:
T- Type ofCodegenWriterto create.
- All Superinterfaces:
BiFunction<String,String, T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
@Deprecated
public interface CodegenWriterFactory<T extends CodegenWriter<T,?>>
extends BiFunction<String,String,T>
Deprecated.
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);
-
Method Summary
Methods inherited from interface java.util.function.BiFunction
andThen
-
Method Details
-
apply
Deprecated.Creates aCodegenWriterof typeTfor the given filename and namespace.- Specified by:
applyin interfaceBiFunction<String,String, T extends CodegenWriter<T, ?>> - Parameters:
filename- Non-null filename of the writer being created.namespace- Non-null namespace associated with the file (possibly empty string).- Returns:
- Returns the created writer of type
T.
-
SymbolWriter.Factory. This will be removed in a future release.