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

org.openqa.selenium.devtools.v90.runtime.model.ExceptionThrown Maven / Gradle / Ivy

package org.openqa.selenium.devtools.v90.runtime.model;

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

/**
 * Issued when exception was thrown and unhandled.
 */
public class ExceptionThrown {

    private final org.openqa.selenium.devtools.v90.runtime.model.Timestamp timestamp;

    private final org.openqa.selenium.devtools.v90.runtime.model.ExceptionDetails exceptionDetails;

    public ExceptionThrown(org.openqa.selenium.devtools.v90.runtime.model.Timestamp timestamp, org.openqa.selenium.devtools.v90.runtime.model.ExceptionDetails exceptionDetails) {
        this.timestamp = java.util.Objects.requireNonNull(timestamp, "timestamp is required");
        this.exceptionDetails = java.util.Objects.requireNonNull(exceptionDetails, "exceptionDetails is required");
    }

    /**
     * Timestamp of the exception.
     */
    public org.openqa.selenium.devtools.v90.runtime.model.Timestamp getTimestamp() {
        return timestamp;
    }

    public org.openqa.selenium.devtools.v90.runtime.model.ExceptionDetails getExceptionDetails() {
        return exceptionDetails;
    }

    private static ExceptionThrown fromJson(JsonInput input) {
        org.openqa.selenium.devtools.v90.runtime.model.Timestamp timestamp = null;
        org.openqa.selenium.devtools.v90.runtime.model.ExceptionDetails exceptionDetails = null;
        input.beginObject();
        while (input.hasNext()) {
            switch(input.nextName()) {
                case "timestamp":
                    timestamp = input.read(org.openqa.selenium.devtools.v90.runtime.model.Timestamp.class);
                    break;
                case "exceptionDetails":
                    exceptionDetails = input.read(org.openqa.selenium.devtools.v90.runtime.model.ExceptionDetails.class);
                    break;
                default:
                    input.skipValue();
                    break;
            }
        }
        input.endObject();
        return new ExceptionThrown(timestamp, exceptionDetails);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy