package g5;

import android.text.TextUtils;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public final class t implements p {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Map f26226b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public volatile Map f26227c;

    public t(Map map) {
        this.f26226b = Collections.unmodifiableMap(map);
    }

    @Override // g5.p
    public final Map a() {
        if (this.f26227c == null) {
            synchronized (this) {
                try {
                    if (this.f26227c == null) {
                        this.f26227c = Collections.unmodifiableMap(b());
                    }
                } finally {
                }
            }
        }
        return this.f26227c;
    }

    public final HashMap b() {
        HashMap map = new HashMap();
        for (Map.Entry entry : this.f26226b.entrySet()) {
            List list = (List) entry.getValue();
            StringBuilder sb = new StringBuilder();
            int size = list.size();
            for (int i10 = 0; i10 < size; i10++) {
                String str = ((s) ((q) list.get(i10))).f26223a;
                if (!TextUtils.isEmpty(str)) {
                    sb.append(str);
                    if (i10 != list.size() - 1) {
                        sb.append(',');
                    }
                }
            }
            String string = sb.toString();
            if (!TextUtils.isEmpty(string)) {
                map.put(entry.getKey(), string);
            }
        }
        return map;
    }

    public final boolean equals(Object obj) {
        if (obj instanceof t) {
            return this.f26226b.equals(((t) obj).f26226b);
        }
        return false;
    }

    public final int hashCode() {
        return this.f26226b.hashCode();
    }

    public final String toString() {
        return "LazyHeaders{headers=" + this.f26226b + '}';
    }
}
