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

io.metersphere.constants.HttpMethodConstants Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package io.metersphere.constants;

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

public enum HttpMethodConstants {
    GET,
    HEAD,
    POST,
    PUT,
    PATCH,
    DELETE,
    OPTIONS,
    TRACE;

    private static final Map mappings = new HashMap(16);

    private HttpMethodConstants() {
    }

    public static HttpMethodConstants resolve(String method) {
        return method != null ? (HttpMethodConstants) mappings.get(method) : null;
    }

    public boolean matches(String method) {
        return this.name().equals(method);
    }

    static {
        HttpMethodConstants[] var0 = values();
        int var1 = var0.length;

        for (int var2 = 0; var2 < var1; ++var2) {
            HttpMethodConstants HttpMethodConstants = var0[var2];
            mappings.put(HttpMethodConstants.name(), HttpMethodConstants);
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy