@Test public void testVersionedPackage() throws Exception { AdWordsServiceClientFactoryHelper helper = new AdWordsServiceClientFactoryHelper( adsServiceClientFactory, adsServiceDescriptorFactory, soapClientHandler, adsLibConfiguration); assertEquals("v201406", helper.determineVersion( com.google.api.ads.adwords.lib.factory.helper.testing.v201406.cm.TestService.class)); }
@Override public String determineVersion(Class<?> interfaceClass) { Matcher m = VERSION_PATTERN.matcher(interfaceClass.getPackage().getName()); if (m.matches()) { return m.group(1); } else { return adsLibConfiguration.getDuckTypedVersion(); } }
AdWordsServiceClientFactoryHelper extends
    BaseAdsServiceClientFactoryHelper<AdWordsServiceClient,
                                      AdWordsSession,
                                      AdWordsServiceDescriptor> { @Override public String determineVersion(Class<?> interfaceClass) { Matcher m = VERSION_PATTERN.matcher(interfaceClass.getPackage().getName()); if (m.matches()) { return m.group(1); } else { return adsLibConfiguration.getDuckTypedVersion(); } } }
AdWordsServiceClientFactoryHelper extends
    BaseAdsServiceClientFactoryHelper<AdWordsServiceClient,
                                      AdWordsSession,
                                      AdWordsServiceDescriptor> { @Override public String determineVersion(Class<?> interfaceClass) { Matcher m = VERSION_PATTERN.matcher(interfaceClass.getPackage().getName()); if (m.matches()) { return m.group(1); } else { return adsLibConfiguration.getDuckTypedVersion(); } } @SuppressWarnings("unchecked") /* See comments on soapClientHandler argument. */ @Inject  AdWordsServiceClientFactoryHelper(
      AdsServiceClientFactoryInterface<AdWordsServiceClient,
                                       AdWordsSession,
                                       AdWordsServiceDescriptor> adsServiceClientFactory,
      AdsServiceDescriptorFactoryInterface<AdWordsServiceDescriptor> adsServiceDescriptorFactory,
      @SuppressWarnings("rawtypes") /* Guice binding for SoapClientHandlerInterface does not include
                                     * the type argument T because it is bound in the SOAP
                                     * toolkit-agnostic configuration module. Therefore, must use
                                     * the raw type here. */
      SoapClientHandlerInterface soapClientHandler,
      AdsLibConfiguration adsLibConfiguration); }
AdWordsServiceClientFactoryHelper extends
    BaseAdsServiceClientFactoryHelper<AdWordsServiceClient,
                                      AdWordsSession,
                                      AdWordsServiceDescriptor> { @Override public String determineVersion(Class<?> interfaceClass) { Matcher m = VERSION_PATTERN.matcher(interfaceClass.getPackage().getName()); if (m.matches()) { return m.group(1); } else { return adsLibConfiguration.getDuckTypedVersion(); } } @SuppressWarnings("unchecked") /* See comments on soapClientHandler argument. */ @Inject  AdWordsServiceClientFactoryHelper(
      AdsServiceClientFactoryInterface<AdWordsServiceClient,
                                       AdWordsSession,
                                       AdWordsServiceDescriptor> adsServiceClientFactory,
      AdsServiceDescriptorFactoryInterface<AdWordsServiceDescriptor> adsServiceDescriptorFactory,
      @SuppressWarnings("rawtypes") /* Guice binding for SoapClientHandlerInterface does not include
                                     * the type argument T because it is bound in the SOAP
                                     * toolkit-agnostic configuration module. Therefore, must use
                                     * the raw type here. */
      SoapClientHandlerInterface soapClientHandler,
      AdsLibConfiguration adsLibConfiguration); @Override String determineVersion(Class<?> interfaceClass); }
AdWordsServiceClientFactoryHelper extends
    BaseAdsServiceClientFactoryHelper<AdWordsServiceClient,
                                      AdWordsSession,
                                      AdWordsServiceDescriptor> { @Override public String determineVersion(Class<?> interfaceClass) { Matcher m = VERSION_PATTERN.matcher(interfaceClass.getPackage().getName()); if (m.matches()) { return m.group(1); } else { return adsLibConfiguration.getDuckTypedVersion(); } } @SuppressWarnings("unchecked") /* See comments on soapClientHandler argument. */ @Inject  AdWordsServiceClientFactoryHelper(
      AdsServiceClientFactoryInterface<AdWordsServiceClient,
                                       AdWordsSession,
                                       AdWordsServiceDescriptor> adsServiceClientFactory,
      AdsServiceDescriptorFactoryInterface<AdWordsServiceDescriptor> adsServiceDescriptorFactory,
      @SuppressWarnings("rawtypes") /* Guice binding for SoapClientHandlerInterface does not include
                                     * the type argument T because it is bound in the SOAP
                                     * toolkit-agnostic configuration module. Therefore, must use
                                     * the raw type here. */
      SoapClientHandlerInterface soapClientHandler,
      AdsLibConfiguration adsLibConfiguration); @Override String determineVersion(Class<?> interfaceClass);  }