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

org.openqa.selenium.devtools.v88.heapprofiler.model.SamplingHeapProfile Maven / Gradle / Ivy

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

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

/**
 * Sampling profile.
 */
public class SamplingHeapProfile {

    private final org.openqa.selenium.devtools.v88.heapprofiler.model.SamplingHeapProfileNode head;

    private final java.util.List samples;

    public SamplingHeapProfile(org.openqa.selenium.devtools.v88.heapprofiler.model.SamplingHeapProfileNode head, java.util.List samples) {
        this.head = java.util.Objects.requireNonNull(head, "head is required");
        this.samples = java.util.Objects.requireNonNull(samples, "samples is required");
    }

    public org.openqa.selenium.devtools.v88.heapprofiler.model.SamplingHeapProfileNode getHead() {
        return head;
    }

    public java.util.List getSamples() {
        return samples;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy