52 lines
1.6 KiB
Java
52 lines
1.6 KiB
Java
package com.hcaptcha.sdk;
|
|
|
|
import androidx.annotation.Nullable;
|
|
import c.d.b.a.a;
|
|
import java.util.Objects;
|
|
public class HCaptchaException extends Exception {
|
|
public final HCaptchaError hCaptchaError;
|
|
|
|
public HCaptchaException(HCaptchaError hCaptchaError) {
|
|
this.hCaptchaError = hCaptchaError;
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof HCaptchaException)) {
|
|
return false;
|
|
}
|
|
HCaptchaException hCaptchaException = (HCaptchaException) obj;
|
|
Objects.requireNonNull(hCaptchaException);
|
|
if (!super.equals(obj)) {
|
|
return false;
|
|
}
|
|
HCaptchaError hCaptchaError = this.hCaptchaError;
|
|
HCaptchaError hCaptchaError2 = hCaptchaException.hCaptchaError;
|
|
return hCaptchaError != null ? hCaptchaError.equals(hCaptchaError2) : hCaptchaError2 == null;
|
|
}
|
|
|
|
@Override // java.lang.Throwable
|
|
@Nullable
|
|
public String getMessage() {
|
|
return this.hCaptchaError.getMessage();
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public int hashCode() {
|
|
int hashCode = super.hashCode();
|
|
HCaptchaError hCaptchaError = this.hCaptchaError;
|
|
return (hashCode * 59) + (hCaptchaError == null ? 43 : hCaptchaError.hashCode());
|
|
}
|
|
|
|
@Override // java.lang.Throwable, java.lang.Object
|
|
public String toString() {
|
|
StringBuilder K = a.K("HCaptchaException(hCaptchaError=");
|
|
K.append(this.hCaptchaError);
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|