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

org.openqa.selenium.devtools.storage.model.StorageType Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 4.0.0-rc-1
Show newest version
package org.openqa.selenium.devtools.storage.model;

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

/**
 * Enum of possible storage types.
 */
public enum StorageType {

    APPCACHE("appcache"),
    COOKIES("cookies"),
    FILE_SYSTEMS("file_systems"),
    INDEXEDDB("indexeddb"),
    LOCAL_STORAGE("local_storage"),
    SHADER_CACHE("shader_cache"),
    WEBSQL("websql"),
    SERVICE_WORKERS("service_workers"),
    CACHE_STORAGE("cache_storage"),
    ALL("all"),
    OTHER("other");

    private String value;

    StorageType(String value) {
        this.value = value;
    }

    public static StorageType fromString(String s) {
        return java.util.Arrays.stream(StorageType.values()).filter(rs -> rs.value.equalsIgnoreCase(s)).findFirst().orElseThrow(() -> new org.openqa.selenium.devtools.DevToolsException("Given value " + s + " is not found within StorageType "));
    }

    public String toString() {
        return value;
    }

    public String toJson() {
        return value;
    }

    private static StorageType fromJson(JsonInput input) {
        return fromString(input.nextString());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy