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

org.openqa.selenium.devtools.v88.systeminfo.model.GPUInfo Maven / Gradle / Ivy

package org.openqa.selenium.devtools.v88.systeminfo.model;

import org.openqa.selenium.Beta;
import org.openqa.selenium.json.JsonInput;

/**
 * Provides information about the GPU(s) on the system.
 */
public class GPUInfo {

    private final java.util.List devices;

    private final java.util.Optional> auxAttributes;

    private final java.util.Optional> featureStatus;

    private final java.util.List driverBugWorkarounds;

    private final java.util.List videoDecoding;

    private final java.util.List videoEncoding;

    private final java.util.List imageDecoding;

    public GPUInfo(java.util.List devices, java.util.Optional> auxAttributes, java.util.Optional> featureStatus, java.util.List driverBugWorkarounds, java.util.List videoDecoding, java.util.List videoEncoding, java.util.List imageDecoding) {
        this.devices = java.util.Objects.requireNonNull(devices, "devices is required");
        this.auxAttributes = auxAttributes;
        this.featureStatus = featureStatus;
        this.driverBugWorkarounds = java.util.Objects.requireNonNull(driverBugWorkarounds, "driverBugWorkarounds is required");
        this.videoDecoding = java.util.Objects.requireNonNull(videoDecoding, "videoDecoding is required");
        this.videoEncoding = java.util.Objects.requireNonNull(videoEncoding, "videoEncoding is required");
        this.imageDecoding = java.util.Objects.requireNonNull(imageDecoding, "imageDecoding is required");
    }

    /**
     * The graphics devices on the system. Element 0 is the primary GPU.
     */
    public java.util.List getDevices() {
        return devices;
    }

    /**
     * An optional dictionary of additional GPU related attributes.
     */
    public java.util.Optional> getAuxAttributes() {
        return auxAttributes;
    }

    /**
     * An optional dictionary of graphics features and their status.
     */
    public java.util.Optional> getFeatureStatus() {
        return featureStatus;
    }

    /**
     * An optional array of GPU driver bug workarounds.
     */
    public java.util.List getDriverBugWorkarounds() {
        return driverBugWorkarounds;
    }

    /**
     * Supported accelerated video decoding capabilities.
     */
    public java.util.List getVideoDecoding() {
        return videoDecoding;
    }

    /**
     * Supported accelerated video encoding capabilities.
     */
    public java.util.List getVideoEncoding() {
        return videoEncoding;
    }

    /**
     * Supported accelerated image decoding capabilities.
     */
    public java.util.List getImageDecoding() {
        return imageDecoding;
    }

    private static GPUInfo fromJson(JsonInput input) {
        java.util.List devices = null;
        java.util.Optional> auxAttributes = java.util.Optional.empty();
        java.util.Optional> featureStatus = java.util.Optional.empty();
        java.util.List driverBugWorkarounds = null;
        java.util.List videoDecoding = null;
        java.util.List videoEncoding = null;
        java.util.List imageDecoding = null;
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "devices":
                    devices = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                case "auxAttributes":
                    auxAttributes = java.util.Optional.ofNullable(input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType()));
                    break;
                case "featureStatus":
                    featureStatus = java.util.Optional.ofNullable(input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType()));
                    break;
                case "driverBugWorkarounds":
                    driverBugWorkarounds = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                case "videoDecoding":
                    videoDecoding = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                case "videoEncoding":
                    videoEncoding = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                case "imageDecoding":
                    imageDecoding = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new GPUInfo(devices, auxAttributes, featureStatus, driverBugWorkarounds, videoDecoding, videoEncoding, imageDecoding);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy