Interface CodegenWriterFactory<T extends CodegenWriter<T,?>>

Type Parameters:
T - Type of CodegenWriter to 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.
prefer SymbolWriter.Factory. This will be removed in a future release.

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

    Modifier and Type
    Method
    Description
    apply(String filename, String namespace)
    Deprecated.
    Creates a CodegenWriter of type T for the given filename and namespace.

    Methods inherited from interface java.util.function.BiFunction

    andThen
  • Method Details

    • apply

      T apply(String filename, String namespace)
      Deprecated.
      Creates a CodegenWriter of type T for the given filename and namespace.
      Specified by:
      apply in interface BiFunction<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.