package c9;

import android.database.Cursor;
import androidx.sqlite.db.SupportSQLiteStatement;
import f5.j;
import f5.r;
import f5.u;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/* loaded from: classes.dex */
public final class b implements c9.a {

    /* renamed from: a, reason: collision with root package name */
    private final r f7493a;

    /* renamed from: b, reason: collision with root package name */
    private final j f7494b;

    /* loaded from: classes.dex */
    class a extends j {
        a(r rVar) {
            super(rVar);
        }

        @Override // f5.z
        protected String e() {
            return "INSERT OR REPLACE INTO `SavedAddressItem` (`id`,`text`,`highlight`,`cursor`,`description`,`next`) VALUES (?,?,?,?,?,?)";
        }

        /* JADX INFO: Access modifiers changed from: protected */
        @Override // f5.j
        /* renamed from: l, reason: merged with bridge method [inline-methods] */
        public void i(SupportSQLiteStatement supportSQLiteStatement, c cVar) {
            supportSQLiteStatement.bindString(1, cVar.d());
            if (cVar.f() == null) {
                supportSQLiteStatement.bindNull(2);
            } else {
                supportSQLiteStatement.bindString(2, cVar.f());
            }
            if (cVar.c() == null) {
                supportSQLiteStatement.bindNull(3);
            } else {
                supportSQLiteStatement.bindString(3, cVar.c());
            }
            supportSQLiteStatement.bindLong(4, cVar.a());
            if (cVar.b() == null) {
                supportSQLiteStatement.bindNull(5);
            } else {
                supportSQLiteStatement.bindString(5, cVar.b());
            }
            if (cVar.e() == null) {
                supportSQLiteStatement.bindNull(6);
            } else {
                supportSQLiteStatement.bindString(6, cVar.e());
            }
        }
    }

    public b(r rVar) {
        this.f7493a = rVar;
        this.f7494b = new a(rVar);
    }

    public static List a() {
        return Collections.emptyList();
    }

    @Override // c9.a
    public List b() {
        u d10 = u.d("SELECT * FROM SavedAddressItem", 0);
        this.f7493a.d();
        Cursor b10 = h5.b.b(this.f7493a, d10, false, null);
        try {
            int d11 = h5.a.d(b10, "id");
            int d12 = h5.a.d(b10, "text");
            int d13 = h5.a.d(b10, "highlight");
            int d14 = h5.a.d(b10, "cursor");
            int d15 = h5.a.d(b10, "description");
            int d16 = h5.a.d(b10, "next");
            ArrayList arrayList = new ArrayList(b10.getCount());
            while (b10.moveToNext()) {
                arrayList.add(new c(b10.getString(d11), b10.isNull(d12) ? null : b10.getString(d12), b10.isNull(d13) ? null : b10.getString(d13), b10.getInt(d14), b10.isNull(d15) ? null : b10.getString(d15), b10.isNull(d16) ? null : b10.getString(d16)));
            }
            return arrayList;
        } finally {
            b10.close();
            d10.release();
        }
    }

    @Override // c9.a
    public void c(c cVar) {
        this.f7493a.d();
        this.f7493a.e();
        try {
            this.f7494b.k(cVar);
            this.f7493a.C();
        } finally {
            this.f7493a.i();
        }
    }
}
