package com.linecorp.linesdk;

import android.os.Parcel;
import android.os.Parcelable;
import com.bytedance.covode.number.Covode;
import java.io.PrintWriter;
import java.io.StringWriter;

public class LineApiError implements Parcelable {
    public static final Parcelable.Creator<LineApiError> CREATOR = new Parcelable.Creator<LineApiError>() {
        static {
            Covode.recordClassIndex(46012);
        }

        public final /* bridge */ /* synthetic */ Object[] newArray(int i) {
            return new LineApiError[i];
        }

        public final /* synthetic */ Object createFromParcel(Parcel parcel) {
            return new LineApiError(parcel, (byte) 0);
        }
    };
    public static final LineApiError LIZ = new LineApiError(-1, "");
    public final int LIZIZ;
    public final String LIZJ;

    public int describeContents() {
        return 0;
    }

    public int hashCode() {
        int i;
        int i2 = this.LIZIZ * 31;
        String str = this.LIZJ;
        if (str != null) {
            i = str.hashCode();
        } else {
            i = 0;
        }
        return i2 + i;
    }

    static {
        Covode.recordClassIndex(46011);
    }

    public String toString() {
        return "LineApiError{httpResponseCode=" + this.LIZIZ + ", message='" + this.LIZJ + '\'' + '}';
    }

    public LineApiError(Parcel parcel) {
        this.LIZIZ = parcel.readInt();
        this.LIZJ = parcel.readString();
    }

    public static String LIZ(Exception exc) {
        if (exc == null) {
            return null;
        }
        StringWriter stringWriter = new StringWriter();
        exc.printStackTrace(new PrintWriter(stringWriter));
        return stringWriter.toString();
    }

    public LineApiError(Exception exc) {
        this(-1, LIZ(exc));
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            LineApiError lineApiError = (LineApiError) obj;
            if (this.LIZIZ != lineApiError.LIZIZ) {
                return false;
            }
            String str = this.LIZJ;
            String str2 = lineApiError.LIZJ;
            if (str != null) {
                return str.equals(str2);
            }
            if (str2 == null) {
                return true;
            }
        }
        return false;
    }

    public LineApiError(String str) {
        this(-1, str);
    }

    public /* synthetic */ LineApiError(Parcel parcel, byte b) {
        this(parcel);
    }

    public LineApiError(int i, Exception exc) {
        this(i, LIZ(exc));
    }

    public LineApiError(int i, String str) {
        this.LIZIZ = i;
        this.LIZJ = str;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(this.LIZIZ);
        parcel.writeString(this.LIZJ);
    }
}
