Interface SymbolWriter.Factory<W extends SymbolWriter<W,? extends ImportContainer>>
-
- Type Parameters:
W
- Type ofSymbolWriter
to create.
- All Superinterfaces:
java.util.function.BiFunction<java.lang.String,java.lang.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 java.util.function.BiFunction<java.lang.String,java.lang.String,W>
Factory used to create aSymbolWriter
.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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description W
apply(java.lang.String filename, java.lang.String namespace)
Creates aSymbolWriter
of typeW
for the given filename and namespace.
-
-
-
Method Detail
-
apply
W apply(java.lang.String filename, java.lang.String namespace)
Creates aSymbolWriter
of typeW
for the given filename and namespace.- Specified by:
apply
in interfacejava.util.function.BiFunction<java.lang.String,java.lang.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
.
-
-