All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mike10004.seleniumhelp.NoProxySpecification Maven / Gradle / Ivy

There is a newer version: 0.58
Show newest version
package com.github.mike10004.seleniumhelp;

import org.openqa.selenium.Proxy;

import javax.annotation.Nullable;

final class NoProxySpecification {

    private static final NoProxySpecification INSTANCE = new NoProxySpecification();

    private final WebdrivingProxyDefinition webdriving = new NoWebdrivingProxyDefinition();

    private final UpstreamProxyDefinition upstream = new NoUpstreamProxyDefinition();

    private NoProxySpecification() {}

    public static NoProxySpecification getInstance() {
        return INSTANCE;
    }

    public WebdrivingProxyDefinition asWebdrivingProxyDefinition() {
        return webdriving;
    }

    public UpstreamProxyDefinition asUpstreamProxyDefinition() {
        return upstream;
    }

    @Override
    public String toString() {
        return "NoProxySpecification{}";
    }

    private static class NoWebdrivingProxyDefinition implements WebdrivingProxyDefinition {

        @Nullable
        @Override
        public Proxy createWebdrivingProxy() {
            return null;
        }

        @Override
        public String toString() {
            return "WebdrivingProxyDefinition{NO_PROXY}";
        }
    }

    private static class NoUpstreamProxyDefinition implements UpstreamProxyDefinition {

        @Nullable
        @Override
        public UpstreamProxy createUpstreamProxy() {
            return null;
        }

        @Override
        public String toString() {
            return "UpstreamProxyDefinition{NO_PROXY}";
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy