package org.cobbzilla.util.http;

public enum  HttpSchemes {

    http, https;

    public static HttpSchemes from(String s) {
        return valueOf(s.toLowerCase());
    }

    public static boolean isValid(String s) {
        s = s.toLowerCase();
        for (HttpSchemes scheme : values()) {
            if (s.startsWith(scheme.name())) return true;
        }
        return false;
    }
}

@@ -27,16 +27,70 @@
 .http;%0A%0A
+import com.fasterxml.jackson.annotation.JsonCreator;%0A%0A
 public e
@@ -149,44 +149,727 @@
 tic 
-HttpSchemes from(String s) %7B%0A       
+final String SCHEME_HTTP = http.schemeWithSeparator();%0A    public static final String SCHEME_HTTPS = https.schemeWithSeparator();%0A    public static final String PROTOCOL_SEP = %22://%22;%0A%0A    private String schemeWithSeparator() %7B return this.name()+PROTOCOL_SEP; %7D%0A%0A    public static boolean isHttpOrHttps(String val) %7B%0A        return val != null && (val.startsWith(SCHEME_HTTP) %7C%7C val.startsWith(SCHEME_HTTPS));%0A    %7D%0A%0A    public static String stripScheme(String val) %7B%0A        if (val == null) return val;%0A        final int protoPos = val.indexOf(PROTOCOL_SEP);%0A        return protoPos == -1 ? val : val.substring(protoPos+PROTOCOL_SEP.length());%0A    %7D%0A%0A    @JsonCreator public static HttpSchemes fromString (String s) %7B
  ret
@@ -893,28 +893,24 @@
 owerCase());
-%0A   
  %7D%0A%0A    publ

add more utility constants/methods to HttpSchemes