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

com.github.nscuro.wdm.binary.opera.OperaChromiumDriverPlatform Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
package com.github.nscuro.wdm.binary.opera;

import com.github.nscuro.wdm.Architecture;
import com.github.nscuro.wdm.Os;
import com.github.nscuro.wdm.Platform;

import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collections;
import java.util.Optional;
import java.util.Set;

/**
 * Platforms that are supported by OperaChromiumDriver
 */
enum OperaChromiumDriverPlatform implements Platform {

    LINUX64(Os.LINUX, Architecture.X64),

    /**
     * @deprecated Since 2.29, 32bit Linux is not supported anmore,
     *         see release notes
     */
    LINUX32(Os.LINUX, Architecture.X86),

    MAC64(Os.MACOS, Architecture.X64),

    WIN32(Os.WINDOWS, Architecture.X86),

    WIN64(Os.WINDOWS, Architecture.X64);

    private final Os os;

    private final Architecture architecture;

    OperaChromiumDriverPlatform(final Os os, final Architecture architecture) {
        this.os = os;
        this.architecture = architecture;
    }

    static Optional valueOf(final Os os, final Architecture architecture) {
        return Arrays.stream(values())
                .filter(platform -> platform.getOs() == os)
                .filter(platform -> platform.getArchitectures().contains(architecture))
                .findAny();
    }

    @Nonnull
    @Override
    public String getName() {
        return name().toLowerCase();
    }

    @Nonnull
    @Override
    public Os getOs() {
        return os;
    }

    @Nonnull
    @Override
    public Set getArchitectures() {
        return Collections.singleton(architecture);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy