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

org.openqa.selenium.devtools.v88.overlay.model.HingeConfig Maven / Gradle / Ivy

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

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

/**
 * Configuration for dual screen hinge
 */
public class HingeConfig {

    private final org.openqa.selenium.devtools.v88.dom.model.Rect rect;

    private final java.util.Optional contentColor;

    private final java.util.Optional outlineColor;

    public HingeConfig(org.openqa.selenium.devtools.v88.dom.model.Rect rect, java.util.Optional contentColor, java.util.Optional outlineColor) {
        this.rect = java.util.Objects.requireNonNull(rect, "rect is required");
        this.contentColor = contentColor;
        this.outlineColor = outlineColor;
    }

    /**
     * A rectangle represent hinge
     */
    public org.openqa.selenium.devtools.v88.dom.model.Rect getRect() {
        return rect;
    }

    /**
     * The content box highlight fill color (default: a dark color).
     */
    public java.util.Optional getContentColor() {
        return contentColor;
    }

    /**
     * The content box highlight outline color (default: transparent).
     */
    public java.util.Optional getOutlineColor() {
        return outlineColor;
    }

    private static HingeConfig fromJson(JsonInput input) {
        org.openqa.selenium.devtools.v88.dom.model.Rect rect = null;
        java.util.Optional contentColor = java.util.Optional.empty();
        java.util.Optional outlineColor = java.util.Optional.empty();
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "rect":
                    rect = input.read(org.openqa.selenium.devtools.v88.dom.model.Rect.class);
                    break;
                case "contentColor":
                    contentColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.v88.dom.model.RGBA.class));
                    break;
                case "outlineColor":
                    outlineColor = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.v88.dom.model.RGBA.class));
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new HingeConfig(rect, contentColor, outlineColor);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy