aboutsummaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/HttpMethod.java
blob: cad15d530bf18bb9ed98c4225a899a183ff662ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package org.openecomp.sdnc.restapicall;

public enum HttpMethod {
    GET, POST, PUT, DELETE, PATCH;

    public static HttpMethod fromString(String s) {
        if (s == null)
            return null;
        if (s.equalsIgnoreCase("get"))
            return GET;
        if (s.equalsIgnoreCase("post"))
            return POST;
        if (s.equalsIgnoreCase("put"))
            return PUT;
        if (s.equalsIgnoreCase("delete"))
            return DELETE;
        if (s.equalsIgnoreCase("patch"))
            return PATCH;
        throw new IllegalArgumentException("Invalid value for HTTP Method: " + s);
    }
}