This method returns a fully configured WebDriver instance based on the
parameters sent.

@param builder
the Builder used to construct the WebDriver instance
@return a fully configured FirefoxDriver instance
519393
private static WebDriver getDriver(final Builder builder) {
		// this is the default value
		DesiredCapabilities capabilities = getCapabilitiesBrowser(builder.browser);
		WebDriver driver = null;

		/**
		 * Setting the proxy
		 */
		LOG.info("Proxy seetings set");
		org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
		if (builder.proxyHost != null && !builder.proxyHost.isEmpty()) {
			if (!builder.proxyHost.equals("direct")) {
				proxy.setAutodetect(false);
				proxy.setHttpProxy(builder.proxyHost + ":" + builder.proxyPort)
						.setFtpProxy(
								builder.proxyHost + ":" + builder.proxyPort)
						.setSslProxy(
								builder.proxyHost + ":" + builder.proxyPort)
						.setNoProxy(builder.noProxyFor);
			} else {
				proxy.setProxyType(ProxyType.DIRECT);
			}
			capabilities.setCapability(CapabilityType.PROXY, proxy);
		}

		/**
		 * the Driver will take screenshots
		 */
		LOG.info("Screenshot capability set");
		capabilities.setCapability(CapabilityType.TAKES_SCREENSHOT, true);

		/**
		 * setting the platform: LINUX, MAC or Windows. Remember that sometimes
		 * the browsers are linked to a platform like IE for example
		 */
		if (builder.platform != null) {
			capabilities.setCapability(CapabilityType.PLATFORM,
					builder.platform);
		}

		if (builder.browserVersion != null) {
			capabilities.setCapability(CapabilityType.VERSION,
					builder.browserVersion);
		}

		/**
		 * set if javascript is enabled
		 */
		capabilities.setJavascriptEnabled(builder.jsEnabled);

		/**
		 * set if the browser will accept all certificates, including the
		 * self-signed ones
		 */
		capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS,
				builder.acceptAllCertificates);

		/**
		 * this will actually create firefox profiles, chrome options and others
		 */
		LOG.info("Adding specific browser settings");
		addSpecificBrowserSettings(capabilities, builder);

		/**
		 * getting an actual WebDriver implementation now
		 */
		LOG.info("Detecting running mode");
		if (builder.runMode.equalsIgnoreCase(Constants.RunMode.GRID)) {
			LOG.info("Run mode GRID. Setting GRID properties");
			try {
				driver = new RemoteWebDriver(new URL(builder.gridUrl),
						capabilities);
				((RemoteWebDriver) driver).setLogLevel(Level.SEVERE);
			} catch (Exception e) {
				LOG.debug("Exception while initiating remote driver:", e);
			}
		} else {
			LOG.info("Normal run mode. Getting driver instance");
			driver = getDriverInstance(capabilities, builder);
		}

		LOG.info("Returning the following driver: " + driver);
		LOG.info("With capabilities: " + capabilities);
		return driver;
	}
508480
public static MethodBuilder getInstance(Context context,
            TypeElement typeElement, MethodWriter writer) {
        return new MethodBuilder(context, typeElement, writer);
    }
415125
public static Description buildDescriptionWith(Consumer<DescriptionBuilder> builder) {
        DescriptionBuilder builder1 = builder();
        builder.accept(builder1);
        return builder1.build();
    }
171457
public <T> T build(final AwsClientBuilder builder, final Class<T> clientType) {
        val cfg = new ClientConfiguration();
        try {
            val localAddress = getSetting("localAddress");
            if (StringUtils.isNotBlank(localAddress)) {
                cfg.setLocalAddress(InetAddress.getByName(localAddress));
            }
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        builder.withClientConfiguration(cfg);

        val key = getSetting("credentialAccessKey");
        val secret = getSetting("credentialSecretKey");
        val credentials = ChainingAWSCredentialsProvider.getInstance(key, secret);
        builder.withCredentials(credentials);

        var region = getSetting("region");
        val currentRegion = Regions.getCurrentRegion();
        if (currentRegion != null && StringUtils.isBlank(region)) {
            region = currentRegion.getName();
        }
        var regionOverride = getSetting("regionOverride");
        if (currentRegion != null && StringUtils.isNotBlank(regionOverride)) {
            regionOverride = currentRegion.getName();
        }
        val finalRegion = StringUtils.defaultIfBlank(regionOverride, region);
        if (StringUtils.isNotBlank(finalRegion)) {
            builder.withRegion(finalRegion);
        }

        val endpoint = getSetting("endpoint");
        if (StringUtils.isNotBlank(endpoint)) {
            builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, finalRegion));
        }

        val result = builder.build();
        return clientType.cast(result);
    }
1277683
Optional<Builder> getBuilder() {
    Optional<TypeElement> builderTypeElement = Optional.empty();
    for (TypeElement containedClass : ElementFilter.typesIn(autoValueClass.getEnclosedElements())) {
      if (hasAnnotationMirror(containedClass, AUTO_VALUE_BUILDER_NAME)) {
        if (!CLASS_OR_INTERFACE.contains(containedClass.getKind())) {
          errorReporter.reportError(
              "@AutoValue.Builder can only apply to a class or an interface", containedClass);
        } else if (!containedClass.getModifiers().contains(Modifier.STATIC)) {
          errorReporter.reportError(
              "@AutoValue.Builder cannot be applied to a non-static class", containedClass);
        } else if (builderTypeElement.isPresent()) {
          errorReporter.reportError(
              autoValueClass + " already has a Builder: " + builderTypeElement.get(),
              containedClass);
        } else {
          builderTypeElement = Optional.of(containedClass);
        }
      }
    }

    if (builderTypeElement.isPresent()) {
      return builderFrom(builderTypeElement.get());
    } else {
      return Optional.empty();
    }
  }
188303
@Nonnull
	public static <T1, T2, R> LBiObjDblFunction<T1, T2, R> biObjDblFunctionFrom(Consumer<LBiObjDblFunctionBuilder<T1, T2, R>> buildingFunction) {
		LBiObjDblFunctionBuilder builder = new LBiObjDblFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
1352427
@Nonnull
	public static <T1, T2, R> LBiObjLongFunction<T1, T2, R> biObjLongFunctionFrom(Consumer<LBiObjLongFunctionBuilder<T1, T2, R>> buildingFunction) {
		LBiObjLongFunctionBuilder builder = new LBiObjLongFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
659029
public static WebDriver getWrappedDriver(final WebDriver webDriver) {
		if (webDriver instanceof EventFiringWebDriver) {
			return ((EventFiringWebDriver) webDriver).getWrappedDriver();
		}

		return webDriver;
	}
246734
@Nonnull
	public static <T, R> LObjIntBoolFunction<T, R> objIntBoolFunctionFrom(Consumer<LObjIntBoolFunctionBuilder<T, R>> buildingFunction) {
		LObjIntBoolFunctionBuilder builder = new LObjIntBoolFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
163802
public static GsonBuilder registerInstant(GsonBuilder builder)
  {
    if (builder == null) { throw new NullPointerException("builder cannot be null"); }

    builder.registerTypeAdapter(INSTANT_TYPE, new InstantConverter());

    return builder;
  }
378283
@Nonnull
	public static <T, R> LObjIntByteFunction<T, R> objIntByteFunctionFrom(Consumer<LObjIntByteFunctionBuilder<T, R>> buildingFunction) {
		LObjIntByteFunctionBuilder builder = new LObjIntByteFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
867821
@Nonnull
	public static <T1, T2, R> LBiObjBoolFunctionBuilder<T1, T2, R> biObjBoolFunction(Consumer<LBiObjBoolFunction<T1, T2, R>> consumer) {
		return new LBiObjBoolFunctionBuilder(consumer);
	}
27132
@Nonnull
	public static <T1, T2> LToDblBiFunction<T1, T2> toDblBiFunctionFrom(Consumer<LToDblBiFunctionBuilder<T1, T2>> buildingFunction) {
		LToDblBiFunctionBuilder builder = new LToDblBiFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
1172969
public <T> T getClient(ClientBuilder<T> clientBuilder) {
        checkArgument(clientBuilder != null, "ClientBuilder is null");
        return jaxwsEnvironment.getClient(clientBuilder);
    }
410327
@CheckReturnValue
  public static <ReqT, RespT> Builder<ReqT, RespT> newBuilder() {
    return newBuilder(null, null);
  }
86607
public DescriptionBuilder property(final Consumer<PropertyBuilder> builder) {
        PropertyBuilder propertyBuilder = PropertyBuilder.builder();
        builder.accept(propertyBuilder);
        replaceOrAddProperty(propertyBuilder.build());
        return this;
    }
996684
@Nonnull
	public static LSrtToDblFunction srtToDblFunctionFrom(Consumer<LSrtToDblFunctionBuilder> buildingFunction) {
		LSrtToDblFunctionBuilder builder = new LSrtToDblFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}