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

io.proximax.connection.HttpProtocol Maven / Gradle / Ivy

The newest version!
package io.proximax.connection;

import java.util.stream.Stream;

/**
 * The enum to indicate http scheme/ protocol
 */
public enum HttpProtocol {
    HTTP ("http"),
    HTTPS ("https");

    private String protocol;

    HttpProtocol(String protocol) {
        this.protocol = protocol;
    }

    /**
     * Get the protocol
     * @return the protocol
     */
    public String getProtocol() {
        return protocol;
    }

    /**
     * Get the enum value from string
     * @param protocol the protocol
     * @return the enum value
     */
    public static HttpProtocol fromString(String protocol) {
        return Stream.of(values()).filter(val -> val.protocol.equals(protocol)).findFirst().orElse(null);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy