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

org.openqa.selenium.devtools.v88.profiler.model.ScriptTypeProfile Maven / Gradle / Ivy

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

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

/**
 * Type profile data collected during runtime for a JavaScript script.
 */
@org.openqa.selenium.Beta()
public class ScriptTypeProfile {

    private final org.openqa.selenium.devtools.v88.runtime.model.ScriptId scriptId;

    private final java.lang.String url;

    private final java.util.List entries;

    public ScriptTypeProfile(org.openqa.selenium.devtools.v88.runtime.model.ScriptId scriptId, java.lang.String url, java.util.List entries) {
        this.scriptId = java.util.Objects.requireNonNull(scriptId, "scriptId is required");
        this.url = java.util.Objects.requireNonNull(url, "url is required");
        this.entries = java.util.Objects.requireNonNull(entries, "entries is required");
    }

    /**
     * JavaScript script id.
     */
    public org.openqa.selenium.devtools.v88.runtime.model.ScriptId getScriptId() {
        return scriptId;
    }

    /**
     * JavaScript script name or url.
     */
    public java.lang.String getUrl() {
        return url;
    }

    /**
     * Type profile entries for parameters and return values of the functions in the script.
     */
    public java.util.List getEntries() {
        return entries;
    }

    private static ScriptTypeProfile fromJson(JsonInput input) {
        org.openqa.selenium.devtools.v88.runtime.model.ScriptId scriptId = null;
        java.lang.String url = null;
        java.util.List entries = null;
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "scriptId":
                    scriptId = input.read(org.openqa.selenium.devtools.v88.runtime.model.ScriptId.class);
                    break;
                case "url":
                    url = input.nextString();
                    break;
                case "entries":
                    entries = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new ScriptTypeProfile(scriptId, url, entries);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy