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

org.openqa.selenium.devtools.v88.dom.model.SetChildNodes Maven / Gradle / Ivy

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

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

/**
 * Fired when backend wants to provide client with the missing DOM structure. This happens upon
 * most of the calls requesting node ids.
 */
public class SetChildNodes {

    private final org.openqa.selenium.devtools.v88.dom.model.NodeId parentId;

    private final java.util.List nodes;

    public SetChildNodes(org.openqa.selenium.devtools.v88.dom.model.NodeId parentId, java.util.List nodes) {
        this.parentId = java.util.Objects.requireNonNull(parentId, "parentId is required");
        this.nodes = java.util.Objects.requireNonNull(nodes, "nodes is required");
    }

    /**
     * Parent node id to populate with children.
     */
    public org.openqa.selenium.devtools.v88.dom.model.NodeId getParentId() {
        return parentId;
    }

    /**
     * Child nodes array.
     */
    public java.util.List getNodes() {
        return nodes;
    }

    private static SetChildNodes fromJson(JsonInput input) {
        org.openqa.selenium.devtools.v88.dom.model.NodeId parentId = null;
        java.util.List nodes = null;
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "parentId":
                    parentId = input.read(org.openqa.selenium.devtools.v88.dom.model.NodeId.class);
                    break;
                case "nodes":
                    nodes = input.read(new com.google.common.reflect.TypeToken>() {
                    }.getType());
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new SetChildNodes(parentId, nodes);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy