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

org.openqa.selenium.devtools.v90.layertree.model.LayerPainted Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 4.0.0-beta-4
Show newest version
package org.openqa.selenium.devtools.v90.layertree.model;

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

public class LayerPainted {

    private final org.openqa.selenium.devtools.v90.layertree.model.LayerId layerId;

    private final org.openqa.selenium.devtools.v90.dom.model.Rect clip;

    public LayerPainted(org.openqa.selenium.devtools.v90.layertree.model.LayerId layerId, org.openqa.selenium.devtools.v90.dom.model.Rect clip) {
        this.layerId = java.util.Objects.requireNonNull(layerId, "layerId is required");
        this.clip = java.util.Objects.requireNonNull(clip, "clip is required");
    }

    /**
     * The id of the painted layer.
     */
    public org.openqa.selenium.devtools.v90.layertree.model.LayerId getLayerId() {
        return layerId;
    }

    /**
     * Clip rectangle.
     */
    public org.openqa.selenium.devtools.v90.dom.model.Rect getClip() {
        return clip;
    }

    private static LayerPainted fromJson(JsonInput input) {
        org.openqa.selenium.devtools.v90.layertree.model.LayerId layerId = null;
        org.openqa.selenium.devtools.v90.dom.model.Rect clip = null;
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "layerId":
                    layerId = input.read(org.openqa.selenium.devtools.v90.layertree.model.LayerId.class);
                    break;
                case "clip":
                    clip = input.read(org.openqa.selenium.devtools.v90.dom.model.Rect.class);
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new LayerPainted(layerId, clip);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy