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

org.openqa.selenium.devtools.v90.audits.model.AffectedRequest 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.audits.model;

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

/**
 * Information about a request that is affected by an inspector issue.
 */
public class AffectedRequest {

    private final org.openqa.selenium.devtools.v90.network.model.RequestId requestId;

    private final java.util.Optional url;

    public AffectedRequest(org.openqa.selenium.devtools.v90.network.model.RequestId requestId, java.util.Optional url) {
        this.requestId = java.util.Objects.requireNonNull(requestId, "requestId is required");
        this.url = url;
    }

    /**
     * The unique request id.
     */
    public org.openqa.selenium.devtools.v90.network.model.RequestId getRequestId() {
        return requestId;
    }

    public java.util.Optional getUrl() {
        return url;
    }

    private static AffectedRequest fromJson(JsonInput input) {
        org.openqa.selenium.devtools.v90.network.model.RequestId requestId = null;
        java.util.Optional url = java.util.Optional.empty();
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "requestId":
                    requestId = input.read(org.openqa.selenium.devtools.v90.network.model.RequestId.class);
                    break;
                case "url":
                    url = java.util.Optional.ofNullable(input.nextString());
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new AffectedRequest(requestId, url);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy