package com.chartboost.sdk.impl;

import android.view.View;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
public class md {
    public static final Pattern b = Pattern.compile("^[a-zA-Z0-9 ]+$");

    /* renamed from: a  reason: collision with root package name */
    public final List f1760a = new ArrayList();

    public List a() {
        return this.f1760a;
    }

    public final hd b(View view) {
        for (hd hdVar : this.f1760a) {
            if (hdVar.c().get() == view) {
                return hdVar;
            }
        }
        return null;
    }

    public final void a(View view) {
        if (view == null) {
            throw new IllegalArgumentException("FriendlyObstruction is null");
        }
    }

    public void b() {
        this.f1760a.clear();
    }

    public void a(View view, i5 i5Var, String str) {
        a(view);
        a(str);
        if (b(view) == null) {
            this.f1760a.add(new hd(view, i5Var, str));
        }
    }

    public final void a(String str) {
        if (str != null) {
            if (str.length() > 50) {
                throw new IllegalArgumentException("FriendlyObstruction has detailed reason over 50 characters in length");
            }
            if (!b.matcher(str).matches()) {
                throw new IllegalArgumentException("FriendlyObstruction has detailed reason that contains characters not in [a-z][A-Z][0-9] or space");
            }
        }
    }
}
