io.proximax.connection.HttpProtocol Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-chain-xipfs-sdk Show documentation
Show all versions of java-chain-xipfs-sdk Show documentation
Official ProximaX P2P Storage SDK Library in Java.
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);
}
}