org.openqa.selenium.devtools.v90.runtime.model.EntryPreview Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenium-devtools-v90 Show documentation
Show all versions of selenium-devtools-v90 Show documentation
Selenium automates browsers. That's it! What you do with that power is entirely up to you.
package org.openqa.selenium.devtools.v90.runtime.model;
import org.openqa.selenium.Beta;
import org.openqa.selenium.json.JsonInput;
@org.openqa.selenium.Beta()
public class EntryPreview {
private final java.util.Optional key;
private final org.openqa.selenium.devtools.v90.runtime.model.ObjectPreview value;
public EntryPreview(java.util.Optional key, org.openqa.selenium.devtools.v90.runtime.model.ObjectPreview value) {
this.key = key;
this.value = java.util.Objects.requireNonNull(value, "value is required");
}
/**
* Preview of the key. Specified for map-like collection entries.
*/
public java.util.Optional getKey() {
return key;
}
/**
* Preview of the value.
*/
public org.openqa.selenium.devtools.v90.runtime.model.ObjectPreview getValue() {
return value;
}
private static EntryPreview fromJson(JsonInput input) {
java.util.Optional key = java.util.Optional.empty();
org.openqa.selenium.devtools.v90.runtime.model.ObjectPreview value = null;
input.beginObject();
while (input.hasNext()) {
switch(input.nextName()) {
case "key":
key = java.util.Optional.ofNullable(input.read(org.openqa.selenium.devtools.v90.runtime.model.ObjectPreview.class));
break;
case "value":
value = input.read(org.openqa.selenium.devtools.v90.runtime.model.ObjectPreview.class);
break;
default:
input.skipValue();
break;
}
}
input.endObject();
return new EntryPreview(key, value);
}
}