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

org.openqa.selenium.devtools.v88.page.model.FrameResourceTree Maven / Gradle / Ivy

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

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

/**
 * Information about the Frame hierarchy along with their cached resources.
 */
@org.openqa.selenium.Beta()
public class FrameResourceTree {

    private final org.openqa.selenium.devtools.v88.page.model.Frame frame;

    private final java.util.Optional> childFrames;

    private final java.util.List resources;

    public FrameResourceTree(org.openqa.selenium.devtools.v88.page.model.Frame frame, java.util.Optional> childFrames, java.util.List resources) {
        this.frame = java.util.Objects.requireNonNull(frame, "frame is required");
        this.childFrames = childFrames;
        this.resources = java.util.Objects.requireNonNull(resources, "resources is required");
    }

    /**
     * Frame information for this tree item.
     */
    public org.openqa.selenium.devtools.v88.page.model.Frame getFrame() {
        return frame;
    }

    /**
     * Child frames.
     */
    public java.util.Optional> getChildFrames() {
        return childFrames;
    }

    /**
     * Information about frame resources.
     */
    public java.util.List getResources() {
        return resources;
    }

    private static FrameResourceTree fromJson(JsonInput input) {
        org.openqa.selenium.devtools.v88.page.model.Frame frame = null;
        java.util.Optional> childFrames = java.util.Optional.empty();
        java.util.List resources = null;
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "frame":
                    frame = input.read(org.openqa.selenium.devtools.v88.page.model.Frame.class);
                    break;
                case "childFrames":
                    childFrames = java.util.Optional.ofNullable(input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType()));
                    break;
                case "resources":
                    resources = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new FrameResourceTree(frame, childFrames, resources);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy