package com.bytedance.sdk.openadsdk.core;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/* JADX INFO: loaded from: classes2.dex */
public class mon {
    private static volatile mon fm;
    private Map<String, Map<String, String>> ro = new ConcurrentHashMap();

    private mon() {
    }

    public static mon fm() {
        if (fm == null) {
            synchronized (mon.class) {
                try {
                    if (fm == null) {
                        fm = new mon();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
        return fm;
    }

    public boolean lb(String str, String str2) {
        Map<String, String> map;
        Map<String, Map<String, String>> map2 = this.ro;
        if (map2 == null || !map2.containsKey(str) || (map = this.ro.get(str)) == null) {
            return false;
        }
        map.remove(str2);
        return true;
    }

    public boolean ro(String str, String str2) {
        Map<String, String> map;
        Map<String, Map<String, String>> map2 = this.ro;
        if (map2 == null || !map2.containsKey(str) || (map = this.ro.get(str)) == null) {
            return false;
        }
        return map.containsKey(str2);
    }

    public void fm(String str, String str2, String str3) {
        Map<String, Map<String, String>> map = this.ro;
        if (map == null) {
            return;
        }
        Map<String, String> map2 = map.get(str);
        if (map2 != null) {
            map2.put(str2, str3);
            return;
        }
        ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
        concurrentHashMap.put(str2, str3);
        this.ro.put(str, concurrentHashMap);
    }

    public String fm(String str, String str2) {
        Map<String, String> map;
        Map<String, Map<String, String>> map2 = this.ro;
        if (map2 == null || !map2.containsKey(str) || (map = this.ro.get(str)) == null) {
            return null;
        }
        return map.get(str2);
    }

    public void fm(String str) {
        Map<String, Map<String, String>> map = this.ro;
        if (map != null && map.containsKey(str)) {
            Map<String, String> map2 = this.ro.get(str);
            if (map2 != null) {
                map2.clear();
            }
            this.ro.remove(str);
        }
    }
}
