package io.netty.handler.codec.rtsp;

import io.netty.handler.codec.http.HttpMethod;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/* JADX INFO: loaded from: classes.dex */
public final class RtspMethods {
    public static final HttpMethod ANNOUNCE;
    public static final HttpMethod DESCRIBE;
    public static final HttpMethod GET_PARAMETER;
    public static final HttpMethod OPTIONS;
    public static final HttpMethod PAUSE;
    public static final HttpMethod PLAY;
    public static final HttpMethod RECORD;
    public static final HttpMethod REDIRECT;
    public static final HttpMethod SETUP;
    public static final HttpMethod SET_PARAMETER;
    public static final HttpMethod TEARDOWN;
    private static final Map<String, HttpMethod> methodMap;

    static {
        HttpMethod httpMethod = HttpMethod.OPTIONS;
        OPTIONS = httpMethod;
        HttpMethod httpMethod2 = new HttpMethod("DESCRIBE");
        DESCRIBE = httpMethod2;
        HttpMethod httpMethod3 = new HttpMethod("ANNOUNCE");
        ANNOUNCE = httpMethod3;
        HttpMethod httpMethod4 = new HttpMethod("SETUP");
        SETUP = httpMethod4;
        HttpMethod httpMethod5 = new HttpMethod("PLAY");
        PLAY = httpMethod5;
        HttpMethod httpMethod6 = new HttpMethod("PAUSE");
        PAUSE = httpMethod6;
        HttpMethod httpMethod7 = new HttpMethod("TEARDOWN");
        TEARDOWN = httpMethod7;
        HttpMethod httpMethod8 = new HttpMethod("GET_PARAMETER");
        GET_PARAMETER = httpMethod8;
        HttpMethod httpMethod9 = new HttpMethod("SET_PARAMETER");
        SET_PARAMETER = httpMethod9;
        HttpMethod httpMethod10 = new HttpMethod("REDIRECT");
        REDIRECT = httpMethod10;
        HttpMethod httpMethod11 = new HttpMethod("RECORD");
        RECORD = httpMethod11;
        HashMap map = new HashMap();
        methodMap = map;
        map.put(httpMethod2.toString(), httpMethod2);
        map.put(httpMethod3.toString(), httpMethod3);
        map.put(httpMethod8.toString(), httpMethod8);
        map.put(httpMethod.toString(), httpMethod);
        map.put(httpMethod6.toString(), httpMethod6);
        map.put(httpMethod5.toString(), httpMethod5);
        map.put(httpMethod11.toString(), httpMethod11);
        map.put(httpMethod10.toString(), httpMethod10);
        map.put(httpMethod4.toString(), httpMethod4);
        map.put(httpMethod9.toString(), httpMethod9);
        map.put(httpMethod7.toString(), httpMethod7);
    }

    private RtspMethods() {
    }

    public static HttpMethod valueOf(String str) {
        Objects.requireNonNull(str, "name");
        String upperCase = str.trim().toUpperCase();
        if (upperCase.isEmpty()) {
            throw new IllegalArgumentException("empty name");
        }
        HttpMethod httpMethod = methodMap.get(upperCase);
        return httpMethod != null ? httpMethod : new HttpMethod(upperCase);
    }
}
