package com.google.android.gms.internal.ads;

import java.util.Map;
import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
public final class ur1 implements Map.Entry {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Object f17372a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f17373b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ zzgtm f17374c;

    public ur1(zzgtm zzgtmVar, int i10) {
        Objects.requireNonNull(zzgtmVar);
        this.f17374c = zzgtmVar;
        this.f17372a = zzgtmVar.b()[i10];
        this.f17373b = i10;
    }

    @Override // java.util.Map.Entry
    /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
    public final boolean equals(Object obj) {
        if (obj instanceof Map.Entry) {
            Map.Entry entry = (Map.Entry) obj;
            if (Objects.equals(this.f17372a, entry.getKey()) && Objects.equals(getValue(), entry.getValue())) {
                return true;
            }
        }
        return false;
    }

    @Override // java.util.Map.Entry
    /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
    public final int hashCode() {
        Object value = getValue();
        Object obj = this.f17372a;
        return (obj == null ? 0 : obj.hashCode()) ^ (value != null ? value.hashCode() : 0);
    }

    /* JADX INFO: renamed from: c, reason: merged with bridge method [inline-methods] */
    public final String toString() {
        String strValueOf = String.valueOf(this.f17372a);
        String strValueOf2 = String.valueOf(getValue());
        return defpackage.e.p(new StringBuilder(strValueOf.length() + 1 + strValueOf2.length()), strValueOf, "=", strValueOf2);
    }

    public final void d() {
        int i10 = this.f17373b;
        Object obj = this.f17372a;
        zzgtm zzgtmVar = this.f17374c;
        if (i10 != -1 && i10 < zzgtmVar.size()) {
            if (Objects.equals(obj, zzgtmVar.b()[this.f17373b])) {
                return;
            }
        }
        this.f17373b = zzgtmVar.l(obj);
    }

    @Override // java.util.Map.Entry
    public final Object getKey() {
        return this.f17372a;
    }

    @Override // java.util.Map.Entry
    public final Object getValue() {
        zzgtm zzgtmVar = this.f17374c;
        Map mapG = zzgtmVar.g();
        if (mapG != null) {
            return mapG.get(this.f17372a);
        }
        d();
        int i10 = this.f17373b;
        if (i10 == -1) {
            return null;
        }
        return zzgtmVar.d()[i10];
    }

    @Override // java.util.Map.Entry
    public final Object setValue(Object obj) {
        zzgtm zzgtmVar = this.f17374c;
        Map mapG = zzgtmVar.g();
        Object obj2 = this.f17372a;
        if (mapG != null) {
            return mapG.put(obj2, obj);
        }
        d();
        int i10 = this.f17373b;
        if (i10 == -1) {
            zzgtmVar.put(obj2, obj);
            return null;
        }
        Object obj3 = zzgtmVar.d()[i10];
        zzgtmVar.d()[this.f17373b] = obj;
        return obj3;
    }
}
