package androidx.window.core;

import android.graphics.Rect;

/* JADX INFO: loaded from: classes.dex */
public final class b {

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f4416c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final int f4417d;

    public b(Rect rect) {
        int i10 = rect.left;
        int i11 = rect.top;
        int i12 = rect.right;
        int i13 = rect.bottom;
        this.f4414a = i10;
        this.f4415b = i11;
        this.f4416c = i12;
        this.f4417d = i13;
        if (i10 > i12) {
            throw new IllegalArgumentException(defpackage.e.f("Left must be less than or equal to right, left: ", i10, ", right: ", i12).toString());
        }
        if (i11 > i13) {
            throw new IllegalArgumentException(defpackage.e.f("top must be less than or equal to bottom, top: ", i11, ", bottom: ", i13).toString());
        }
    }

    public final int a() {
        return this.f4417d - this.f4415b;
    }

    public final int b() {
        return this.f4416c - this.f4414a;
    }

    public final Rect c() {
        return new Rect(this.f4414a, this.f4415b, this.f4416c, this.f4417d);
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!nb.g.c(b.class, obj != null ? obj.getClass() : null)) {
            return false;
        }
        nb.g.g(obj, "null cannot be cast to non-null type androidx.window.core.Bounds");
        b bVar = (b) obj;
        return this.f4414a == bVar.f4414a && this.f4415b == bVar.f4415b && this.f4416c == bVar.f4416c && this.f4417d == bVar.f4417d;
    }

    public final int hashCode() {
        return (((((this.f4414a * 31) + this.f4415b) * 31) + this.f4416c) * 31) + this.f4417d;
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(b.class.getSimpleName());
        sb.append(" { [");
        sb.append(this.f4414a);
        sb.append(',');
        sb.append(this.f4415b);
        sb.append(',');
        sb.append(this.f4416c);
        sb.append(',');
        return u.a.b(sb, this.f4417d, "] }");
    }
}
