Interface SymbolWriter.Factory<W extends SymbolWriter<W,? extends ImportContainer>>
- Type Parameters:
W
- Type ofSymbolWriter
to create.
- All Superinterfaces:
BiFunction<String,
String, W>
- Enclosing class:
- SymbolWriter<W extends SymbolWriter<W,
I>, I extends ImportContainer>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface SymbolWriter.Factory<W extends SymbolWriter<W,? extends ImportContainer>>
extends BiFunction<String,String,W>
Factory used to create a
SymbolWriter
.
The following example shows how to implement a basic Factory
.
public final class MyWriterFactory implements SymbolWriter.Factory<MyWriter> {
\@Override
public MyWriter apply(String filename, String namespace) {
return new MyWriter(namespace);
}
}
Because this class is a FunctionalInterface
, it can be implemented
using a lambda expression:
SymbolWriter.Factory<MyWriter> = (filename, namespace) -> new MyWriter(namespace);
-
Method Summary
Methods inherited from interface java.util.function.BiFunction
andThen
-
Method Details
-
apply
Creates aSymbolWriter
of typeW
for the given filename and namespace.- Specified by:
apply
in interfaceBiFunction<String,
String, W extends SymbolWriter<W, ? extends ImportContainer>> - 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
W
.
-