discord-jadx/app/src/main/java/com/discord/models/domain/ModelPaymentSource.java

413 lines
16 KiB
Java

package com.discord.models.domain;
import androidx.core.app.NotificationCompat;
import b.d.b.a.a;
import com.discord.models.domain.billing.ModelBillingAddress;
import d0.z.d.m;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: ModelPaymentSource.kt */
public abstract class ModelPaymentSource {
public static final Companion Companion = new Companion(null);
private static final int PAYMENT_SOURCE_TYPE_CARD = 1;
private static final int PAYMENT_SOURCE_TYPE_PAYPAL = 2;
private final ModelBillingAddress billingAddress;
/* renamed from: default reason: not valid java name */
private final boolean f6default;
/* renamed from: id reason: collision with root package name */
private final String f2686id;
private final boolean invalid;
/* compiled from: ModelPaymentSource.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final ModelPaymentSource wrap(PaymentSourceRaw paymentSourceRaw) throws UnableToWrapException {
m.checkNotNullParameter(paymentSourceRaw, "raw");
try {
int type = paymentSourceRaw.getType();
if (type == 1) {
String brand = paymentSourceRaw.getBrand();
m.checkNotNull(brand);
String last_4 = paymentSourceRaw.getLast_4();
m.checkNotNull(last_4);
return new ModelPaymentSourceCard(brand, last_4, paymentSourceRaw.getExpiresMonth(), paymentSourceRaw.getExpiresYear(), paymentSourceRaw.getId(), paymentSourceRaw.getInvalid(), paymentSourceRaw.getBillingAddress(), paymentSourceRaw.getDefault());
} else if (type == 2) {
String email = paymentSourceRaw.getEmail();
m.checkNotNull(email);
return new ModelPaymentSourcePaypal(email, paymentSourceRaw.getId(), paymentSourceRaw.getInvalid(), paymentSourceRaw.getBillingAddress(), paymentSourceRaw.getDefault());
} else {
throw new IllegalArgumentException("unsupported payment source type: " + paymentSourceRaw.getType());
}
} catch (Throwable th) {
throw new UnableToWrapException(th);
}
}
}
/* compiled from: ModelPaymentSource.kt */
public static final class ModelPaymentSourceCard extends ModelPaymentSource {
private final ModelBillingAddress billingAddress;
private final String brand;
/* renamed from: default reason: not valid java name */
private final boolean f7default;
private final int expiresMonth;
private final int expiresYear;
/* renamed from: id reason: collision with root package name */
private final String f2687id;
private final boolean invalid;
private final String last4;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ModelPaymentSourceCard(String str, String str2, int i, int i2, String str3, boolean z2, ModelBillingAddress modelBillingAddress, boolean z3) {
super(str3, z2, modelBillingAddress, z3, null);
m.checkNotNullParameter(str, "brand");
m.checkNotNullParameter(str2, "last4");
m.checkNotNullParameter(str3, ModelAuditLogEntry.CHANGE_KEY_ID);
m.checkNotNullParameter(modelBillingAddress, "billingAddress");
this.brand = str;
this.last4 = str2;
this.expiresMonth = i;
this.expiresYear = i2;
this.f2687id = str3;
this.invalid = z2;
this.billingAddress = modelBillingAddress;
this.f7default = z3;
}
public static /* synthetic */ ModelPaymentSourceCard copy$default(ModelPaymentSourceCard modelPaymentSourceCard, String str, String str2, int i, int i2, String str3, boolean z2, ModelBillingAddress modelBillingAddress, boolean z3, int i3, Object obj) {
return modelPaymentSourceCard.copy((i3 & 1) != 0 ? modelPaymentSourceCard.brand : str, (i3 & 2) != 0 ? modelPaymentSourceCard.last4 : str2, (i3 & 4) != 0 ? modelPaymentSourceCard.expiresMonth : i, (i3 & 8) != 0 ? modelPaymentSourceCard.expiresYear : i2, (i3 & 16) != 0 ? modelPaymentSourceCard.getId() : str3, (i3 & 32) != 0 ? modelPaymentSourceCard.getInvalid() : z2, (i3 & 64) != 0 ? modelPaymentSourceCard.getBillingAddress() : modelBillingAddress, (i3 & 128) != 0 ? modelPaymentSourceCard.getDefault() : z3);
}
public final String component1() {
return this.brand;
}
public final String component2() {
return this.last4;
}
public final int component3() {
return this.expiresMonth;
}
public final int component4() {
return this.expiresYear;
}
public final String component5() {
return getId();
}
public final boolean component6() {
return getInvalid();
}
public final ModelBillingAddress component7() {
return getBillingAddress();
}
public final boolean component8() {
return getDefault();
}
public final ModelPaymentSourceCard copy(String str, String str2, int i, int i2, String str3, boolean z2, ModelBillingAddress modelBillingAddress, boolean z3) {
m.checkNotNullParameter(str, "brand");
m.checkNotNullParameter(str2, "last4");
m.checkNotNullParameter(str3, ModelAuditLogEntry.CHANGE_KEY_ID);
m.checkNotNullParameter(modelBillingAddress, "billingAddress");
return new ModelPaymentSourceCard(str, str2, i, i2, str3, z2, modelBillingAddress, z3);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ModelPaymentSourceCard)) {
return false;
}
ModelPaymentSourceCard modelPaymentSourceCard = (ModelPaymentSourceCard) obj;
return m.areEqual(this.brand, modelPaymentSourceCard.brand) && m.areEqual(this.last4, modelPaymentSourceCard.last4) && this.expiresMonth == modelPaymentSourceCard.expiresMonth && this.expiresYear == modelPaymentSourceCard.expiresYear && m.areEqual(getId(), modelPaymentSourceCard.getId()) && getInvalid() == modelPaymentSourceCard.getInvalid() && m.areEqual(getBillingAddress(), modelPaymentSourceCard.getBillingAddress()) && getDefault() == modelPaymentSourceCard.getDefault();
}
@Override // com.discord.models.domain.ModelPaymentSource
public ModelBillingAddress getBillingAddress() {
return this.billingAddress;
}
public final String getBrand() {
return this.brand;
}
@Override // com.discord.models.domain.ModelPaymentSource
public boolean getDefault() {
return this.f7default;
}
public final int getExpiresMonth() {
return this.expiresMonth;
}
public final int getExpiresYear() {
return this.expiresYear;
}
@Override // com.discord.models.domain.ModelPaymentSource
public String getId() {
return this.f2687id;
}
@Override // com.discord.models.domain.ModelPaymentSource
public boolean getInvalid() {
return this.invalid;
}
public final String getLast4() {
return this.last4;
}
public int hashCode() {
String str = this.brand;
int i = 0;
int hashCode = (str != null ? str.hashCode() : 0) * 31;
String str2 = this.last4;
int hashCode2 = (((((hashCode + (str2 != null ? str2.hashCode() : 0)) * 31) + this.expiresMonth) * 31) + this.expiresYear) * 31;
String id2 = getId();
int hashCode3 = (hashCode2 + (id2 != null ? id2.hashCode() : 0)) * 31;
boolean invalid = getInvalid();
int i2 = 1;
if (invalid) {
invalid = true;
}
int i3 = invalid ? 1 : 0;
int i4 = invalid ? 1 : 0;
int i5 = invalid ? 1 : 0;
int i6 = (hashCode3 + i3) * 31;
ModelBillingAddress billingAddress = getBillingAddress();
if (billingAddress != null) {
i = billingAddress.hashCode();
}
int i7 = (i6 + i) * 31;
boolean z2 = getDefault();
if (!z2) {
i2 = z2;
}
return i7 + i2;
}
public String toString() {
StringBuilder R = a.R("ModelPaymentSourceCard(brand=");
R.append(this.brand);
R.append(", last4=");
R.append(this.last4);
R.append(", expiresMonth=");
R.append(this.expiresMonth);
R.append(", expiresYear=");
R.append(this.expiresYear);
R.append(", id=");
R.append(getId());
R.append(", invalid=");
R.append(getInvalid());
R.append(", billingAddress=");
R.append(getBillingAddress());
R.append(", default=");
R.append(getDefault());
R.append(")");
return R.toString();
}
}
/* compiled from: ModelPaymentSource.kt */
public static final class ModelPaymentSourcePaypal extends ModelPaymentSource {
private final ModelBillingAddress billingAddress;
/* renamed from: default reason: not valid java name */
private final boolean f8default;
private final String email;
/* renamed from: id reason: collision with root package name */
private final String f2688id;
private final boolean invalid;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ModelPaymentSourcePaypal(String str, String str2, boolean z2, ModelBillingAddress modelBillingAddress, boolean z3) {
super(str2, z2, modelBillingAddress, z3, null);
m.checkNotNullParameter(str, NotificationCompat.CATEGORY_EMAIL);
m.checkNotNullParameter(str2, ModelAuditLogEntry.CHANGE_KEY_ID);
m.checkNotNullParameter(modelBillingAddress, "billingAddress");
this.email = str;
this.f2688id = str2;
this.invalid = z2;
this.billingAddress = modelBillingAddress;
this.f8default = z3;
}
public static /* synthetic */ ModelPaymentSourcePaypal copy$default(ModelPaymentSourcePaypal modelPaymentSourcePaypal, String str, String str2, boolean z2, ModelBillingAddress modelBillingAddress, boolean z3, int i, Object obj) {
if ((i & 1) != 0) {
str = modelPaymentSourcePaypal.email;
}
if ((i & 2) != 0) {
str2 = modelPaymentSourcePaypal.getId();
}
if ((i & 4) != 0) {
z2 = modelPaymentSourcePaypal.getInvalid();
}
if ((i & 8) != 0) {
modelBillingAddress = modelPaymentSourcePaypal.getBillingAddress();
}
if ((i & 16) != 0) {
z3 = modelPaymentSourcePaypal.getDefault();
}
return modelPaymentSourcePaypal.copy(str, str2, z2, modelBillingAddress, z3);
}
public final String component1() {
return this.email;
}
public final String component2() {
return getId();
}
public final boolean component3() {
return getInvalid();
}
public final ModelBillingAddress component4() {
return getBillingAddress();
}
public final boolean component5() {
return getDefault();
}
public final ModelPaymentSourcePaypal copy(String str, String str2, boolean z2, ModelBillingAddress modelBillingAddress, boolean z3) {
m.checkNotNullParameter(str, NotificationCompat.CATEGORY_EMAIL);
m.checkNotNullParameter(str2, ModelAuditLogEntry.CHANGE_KEY_ID);
m.checkNotNullParameter(modelBillingAddress, "billingAddress");
return new ModelPaymentSourcePaypal(str, str2, z2, modelBillingAddress, z3);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ModelPaymentSourcePaypal)) {
return false;
}
ModelPaymentSourcePaypal modelPaymentSourcePaypal = (ModelPaymentSourcePaypal) obj;
return m.areEqual(this.email, modelPaymentSourcePaypal.email) && m.areEqual(getId(), modelPaymentSourcePaypal.getId()) && getInvalid() == modelPaymentSourcePaypal.getInvalid() && m.areEqual(getBillingAddress(), modelPaymentSourcePaypal.getBillingAddress()) && getDefault() == modelPaymentSourcePaypal.getDefault();
}
@Override // com.discord.models.domain.ModelPaymentSource
public ModelBillingAddress getBillingAddress() {
return this.billingAddress;
}
@Override // com.discord.models.domain.ModelPaymentSource
public boolean getDefault() {
return this.f8default;
}
public final String getEmail() {
return this.email;
}
@Override // com.discord.models.domain.ModelPaymentSource
public String getId() {
return this.f2688id;
}
@Override // com.discord.models.domain.ModelPaymentSource
public boolean getInvalid() {
return this.invalid;
}
public int hashCode() {
String str = this.email;
int i = 0;
int hashCode = (str != null ? str.hashCode() : 0) * 31;
String id2 = getId();
int hashCode2 = (hashCode + (id2 != null ? id2.hashCode() : 0)) * 31;
boolean invalid = getInvalid();
int i2 = 1;
if (invalid) {
invalid = true;
}
int i3 = invalid ? 1 : 0;
int i4 = invalid ? 1 : 0;
int i5 = invalid ? 1 : 0;
int i6 = (hashCode2 + i3) * 31;
ModelBillingAddress billingAddress = getBillingAddress();
if (billingAddress != null) {
i = billingAddress.hashCode();
}
int i7 = (i6 + i) * 31;
boolean z2 = getDefault();
if (!z2) {
i2 = z2;
}
return i7 + i2;
}
public String toString() {
StringBuilder R = a.R("ModelPaymentSourcePaypal(email=");
R.append(this.email);
R.append(", id=");
R.append(getId());
R.append(", invalid=");
R.append(getInvalid());
R.append(", billingAddress=");
R.append(getBillingAddress());
R.append(", default=");
R.append(getDefault());
R.append(")");
return R.toString();
}
}
/* compiled from: ModelPaymentSource.kt */
public static final class UnableToWrapException extends Exception {
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public UnableToWrapException(Throwable th) {
super(th);
m.checkNotNullParameter(th, "cause");
}
}
private ModelPaymentSource(String str, boolean z2, ModelBillingAddress modelBillingAddress, boolean z3) {
this.f2686id = str;
this.invalid = z2;
this.billingAddress = modelBillingAddress;
this.f6default = z3;
}
public /* synthetic */ ModelPaymentSource(String str, boolean z2, ModelBillingAddress modelBillingAddress, boolean z3, DefaultConstructorMarker defaultConstructorMarker) {
this(str, z2, modelBillingAddress, z3);
}
public ModelBillingAddress getBillingAddress() {
return this.billingAddress;
}
public boolean getDefault() {
return this.f6default;
}
public String getId() {
return this.f2686id;
}
public boolean getInvalid() {
return this.invalid;
}
}