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

  • Type Parameters:
    T - Type of CodegenWriter to create.
    All Superinterfaces:
    java.util.function.BiFunction<java.lang.String,​java.lang.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 java.util.function.BiFunction<java.lang.String,​java.lang.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

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      T apply​(java.lang.String filename, java.lang.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 Detail

      • apply

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