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

com.fireflysource.net.http.common.model.ContentEncoding Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package com.fireflysource.net.http.common.model;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

public enum ContentEncoding {

    GZIP("gzip"),
    DEFLATE("deflate"),
    BR("br");

    private static class Holder {
        private static final Map map = new HashMap<>(4);
    }

    private final String value;

    ContentEncoding(String value) {
        this.value = value;
        Holder.map.put(value, this);
    }

    public String getValue() {
        return value;
    }

    public static Optional from(String value) {
        return Optional.ofNullable(value).map(Holder.map::get);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy