Class AbstractGoogleAdsClientCodeGenerator

  • All Implemented Interfaces:
    Generator

    public class AbstractGoogleAdsClientCodeGenerator
    extends java.lang.Object
    implements Generator
    Generates code for and writes the AbstractGoogleAdsClient abstract class, which defines the methods that can be used to gain access to a GoogleAdsVersion for a given version.

    Example generated code snippets:

      protected abstract GoogleAdsAllVersions getGoogleAdsAllVersions();
      ...
      public GoogleAdsVersion getVersion1() { return getGoogleAdsAllVersions().getVersion1(); }
      ...
      public com.google.ads.googleads.v2.services.GoogleAdsVersion getLatestVersion() {
        return getGoogleAdsAllVersions().getLatestVersion();
      }
      
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractGoogleAdsClientCodeGenerator​(java.util.Set<java.lang.Integer> versions, int latestVersion, java.io.File targetDirectory)
      Creates an instance of the generator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.squareup.javapoet.JavaFile generate()
      Generates the code for the AbstractGoogleAdsClient class and writes the file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractGoogleAdsClientCodeGenerator

        public AbstractGoogleAdsClientCodeGenerator​(java.util.Set<java.lang.Integer> versions,
                                                    int latestVersion,
                                                    java.io.File targetDirectory)
        Creates an instance of the generator.
        Parameters:
        versions - available versions of the Google Ads library.
        latestVersion - the latest available version of the Google Ads library.
    • Method Detail

      • generate

        public com.squareup.javapoet.JavaFile generate()
        Generates the code for the AbstractGoogleAdsClient class and writes the file.
        Specified by:
        generate in interface Generator
        Returns: