403 lines
16 KiB
Java
403 lines
16 KiB
Java
package com.discord.widgets.guild_role_subscriptions.tier.model;
|
|
|
|
import a0.a.a.b;
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import androidx.annotation.DrawableRes;
|
|
import c.d.b.a.a;
|
|
import com.discord.api.guildrolesubscription.GuildRoleSubscriptionBenefit;
|
|
import com.discord.api.guildrolesubscription.GuildRoleSubscriptionBenefitType;
|
|
import com.discord.models.domain.ModelAuditLogEntry;
|
|
import com.discord.models.domain.emoji.Emoji;
|
|
import com.discord.models.domain.emoji.ModelEmojiCustom;
|
|
import com.discord.models.domain.emoji.ModelEmojiUnicode;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: Benefit.kt */
|
|
public abstract class Benefit implements Parcelable {
|
|
|
|
/* compiled from: Benefit.kt */
|
|
public static final class ChannelBenefit extends Benefit {
|
|
public static final Parcelable.Creator<ChannelBenefit> CREATOR = new Creator();
|
|
private final Integer channelIconResId;
|
|
private final long channelId;
|
|
private final String description;
|
|
private final Emoji emoji;
|
|
private final String name;
|
|
|
|
public static class Creator implements Parcelable.Creator<ChannelBenefit> {
|
|
@Override // android.os.Parcelable.Creator
|
|
public final ChannelBenefit createFromParcel(Parcel parcel) {
|
|
m.checkNotNullParameter(parcel, "in");
|
|
return new ChannelBenefit(parcel.readString(), (Emoji) parcel.readParcelable(ChannelBenefit.class.getClassLoader()), parcel.readString(), parcel.readInt() != 0 ? Integer.valueOf(parcel.readInt()) : null, parcel.readLong());
|
|
}
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
public final ChannelBenefit[] newArray(int i) {
|
|
return new ChannelBenefit[i];
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public ChannelBenefit(String str, Emoji emoji, String str2, @DrawableRes Integer num, long j) {
|
|
super(null);
|
|
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_NAME);
|
|
m.checkNotNullParameter(emoji, "emoji");
|
|
this.name = str;
|
|
this.emoji = emoji;
|
|
this.description = str2;
|
|
this.channelIconResId = num;
|
|
this.channelId = j;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ ChannelBenefit(String str, Emoji emoji, String str2, Integer num, long j, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(str, emoji, (i & 4) != 0 ? null : str2, (i & 8) != 0 ? null : num, j);
|
|
}
|
|
|
|
public static /* synthetic */ ChannelBenefit copy$default(ChannelBenefit channelBenefit, String str, Emoji emoji, String str2, Integer num, long j, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
str = channelBenefit.getName();
|
|
}
|
|
if ((i & 2) != 0) {
|
|
emoji = channelBenefit.getEmoji();
|
|
}
|
|
if ((i & 4) != 0) {
|
|
str2 = channelBenefit.getDescription();
|
|
}
|
|
if ((i & 8) != 0) {
|
|
num = channelBenefit.channelIconResId;
|
|
}
|
|
if ((i & 16) != 0) {
|
|
j = channelBenefit.channelId;
|
|
}
|
|
return channelBenefit.copy(str, emoji, str2, num, j);
|
|
}
|
|
|
|
public final String component1() {
|
|
return getName();
|
|
}
|
|
|
|
public final Emoji component2() {
|
|
return getEmoji();
|
|
}
|
|
|
|
public final String component3() {
|
|
return getDescription();
|
|
}
|
|
|
|
public final Integer component4() {
|
|
return this.channelIconResId;
|
|
}
|
|
|
|
public final long component5() {
|
|
return this.channelId;
|
|
}
|
|
|
|
public final ChannelBenefit copy(String str, Emoji emoji, String str2, @DrawableRes Integer num, long j) {
|
|
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_NAME);
|
|
m.checkNotNullParameter(emoji, "emoji");
|
|
return new ChannelBenefit(str, emoji, str2, num, j);
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit, java.lang.Object
|
|
public boolean equals(Object obj) {
|
|
if (Benefit.super.equals(obj) && (obj instanceof ChannelBenefit)) {
|
|
ChannelBenefit channelBenefit = (ChannelBenefit) obj;
|
|
if (m.areEqual(this.channelIconResId, channelBenefit.channelIconResId) && this.channelId == channelBenefit.channelId) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final Integer getChannelIconResId() {
|
|
return this.channelIconResId;
|
|
}
|
|
|
|
public final long getChannelId() {
|
|
return this.channelId;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public String getDescription() {
|
|
return this.description;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public Emoji getEmoji() {
|
|
return this.emoji;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public String getName() {
|
|
return this.name;
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public int hashCode() {
|
|
int hashCode = (getEmoji().hashCode() + (getName().hashCode() * 31)) * 31;
|
|
String description = getDescription();
|
|
int i = 0;
|
|
int hashCode2 = (hashCode + (description != null ? description.hashCode() : 0)) * 31;
|
|
Integer num = this.channelIconResId;
|
|
if (num != null) {
|
|
i = num.intValue();
|
|
}
|
|
return b.a(this.channelId) + ((hashCode2 + i) * 31);
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public GuildRoleSubscriptionBenefit toGuildRoleSubscriptionBenefit() {
|
|
Emoji emoji = getEmoji();
|
|
String str = null;
|
|
if (!(emoji instanceof ModelEmojiCustom)) {
|
|
emoji = null;
|
|
}
|
|
ModelEmojiCustom modelEmojiCustom = (ModelEmojiCustom) emoji;
|
|
Long valueOf = modelEmojiCustom != null ? Long.valueOf(modelEmojiCustom.getId()) : null;
|
|
Emoji emoji2 = getEmoji();
|
|
if (!(emoji2 instanceof ModelEmojiUnicode)) {
|
|
emoji2 = null;
|
|
}
|
|
ModelEmojiUnicode modelEmojiUnicode = (ModelEmojiUnicode) emoji2;
|
|
if (modelEmojiUnicode != null) {
|
|
str = modelEmojiUnicode.getSurrogates();
|
|
}
|
|
return new GuildRoleSubscriptionBenefit(valueOf, str, getName(), GuildRoleSubscriptionBenefitType.CHANNEL, getDescription(), Long.valueOf(this.channelId));
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public String toString() {
|
|
StringBuilder P = a.P("ChannelBenefit(name=");
|
|
P.append(getName());
|
|
P.append(", emoji=");
|
|
P.append(getEmoji());
|
|
P.append(", description=");
|
|
P.append(getDescription());
|
|
P.append(", channelIconResId=");
|
|
P.append(this.channelIconResId);
|
|
P.append(", channelId=");
|
|
return a.A(P, this.channelId, ")");
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
int i2;
|
|
m.checkNotNullParameter(parcel, "parcel");
|
|
parcel.writeString(this.name);
|
|
parcel.writeParcelable(this.emoji, i);
|
|
parcel.writeString(this.description);
|
|
Integer num = this.channelIconResId;
|
|
if (num != null) {
|
|
parcel.writeInt(1);
|
|
i2 = num.intValue();
|
|
} else {
|
|
i2 = 0;
|
|
}
|
|
parcel.writeInt(i2);
|
|
parcel.writeLong(this.channelId);
|
|
}
|
|
}
|
|
|
|
/* compiled from: Benefit.kt */
|
|
public static final class IntangibleBenefit extends Benefit {
|
|
public static final Parcelable.Creator<IntangibleBenefit> CREATOR = new Creator();
|
|
private final String description;
|
|
private final Emoji emoji;
|
|
private final String name;
|
|
|
|
public static class Creator implements Parcelable.Creator<IntangibleBenefit> {
|
|
@Override // android.os.Parcelable.Creator
|
|
public final IntangibleBenefit createFromParcel(Parcel parcel) {
|
|
m.checkNotNullParameter(parcel, "in");
|
|
return new IntangibleBenefit(parcel.readString(), (Emoji) parcel.readParcelable(IntangibleBenefit.class.getClassLoader()), parcel.readString());
|
|
}
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
public final IntangibleBenefit[] newArray(int i) {
|
|
return new IntangibleBenefit[i];
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public IntangibleBenefit(String str, Emoji emoji, String str2) {
|
|
super(null);
|
|
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_NAME);
|
|
m.checkNotNullParameter(emoji, "emoji");
|
|
this.name = str;
|
|
this.emoji = emoji;
|
|
this.description = str2;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ IntangibleBenefit(String str, Emoji emoji, String str2, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(str, emoji, (i & 4) != 0 ? null : str2);
|
|
}
|
|
|
|
public static /* synthetic */ IntangibleBenefit copy$default(IntangibleBenefit intangibleBenefit, String str, Emoji emoji, String str2, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
str = intangibleBenefit.getName();
|
|
}
|
|
if ((i & 2) != 0) {
|
|
emoji = intangibleBenefit.getEmoji();
|
|
}
|
|
if ((i & 4) != 0) {
|
|
str2 = intangibleBenefit.getDescription();
|
|
}
|
|
return intangibleBenefit.copy(str, emoji, str2);
|
|
}
|
|
|
|
public final String component1() {
|
|
return getName();
|
|
}
|
|
|
|
public final Emoji component2() {
|
|
return getEmoji();
|
|
}
|
|
|
|
public final String component3() {
|
|
return getDescription();
|
|
}
|
|
|
|
public final IntangibleBenefit copy(String str, Emoji emoji, String str2) {
|
|
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_NAME);
|
|
m.checkNotNullParameter(emoji, "emoji");
|
|
return new IntangibleBenefit(str, emoji, str2);
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit, java.lang.Object
|
|
public boolean equals(Object obj) {
|
|
return Benefit.super.equals(obj) && (obj instanceof IntangibleBenefit);
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public String getDescription() {
|
|
return this.description;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public Emoji getEmoji() {
|
|
return this.emoji;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public String getName() {
|
|
return this.name;
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public int hashCode() {
|
|
int hashCode = (getEmoji().hashCode() + (getName().hashCode() * 31)) * 31;
|
|
String description = getDescription();
|
|
return hashCode + (description != null ? description.hashCode() : 0);
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public GuildRoleSubscriptionBenefit toGuildRoleSubscriptionBenefit() {
|
|
Emoji emoji = getEmoji();
|
|
String str = null;
|
|
if (!(emoji instanceof ModelEmojiCustom)) {
|
|
emoji = null;
|
|
}
|
|
ModelEmojiCustom modelEmojiCustom = (ModelEmojiCustom) emoji;
|
|
Long valueOf = modelEmojiCustom != null ? Long.valueOf(modelEmojiCustom.getId()) : null;
|
|
Emoji emoji2 = getEmoji();
|
|
if (!(emoji2 instanceof ModelEmojiUnicode)) {
|
|
emoji2 = null;
|
|
}
|
|
ModelEmojiUnicode modelEmojiUnicode = (ModelEmojiUnicode) emoji2;
|
|
if (modelEmojiUnicode != null) {
|
|
str = modelEmojiUnicode.getSurrogates();
|
|
}
|
|
return new GuildRoleSubscriptionBenefit(valueOf, str, getName(), GuildRoleSubscriptionBenefitType.INTANGIBLE, getDescription(), null);
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public String toString() {
|
|
StringBuilder P = a.P("IntangibleBenefit(name=");
|
|
P.append(getName());
|
|
P.append(", emoji=");
|
|
P.append(getEmoji());
|
|
P.append(", description=");
|
|
P.append(getDescription());
|
|
P.append(")");
|
|
return P.toString();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
m.checkNotNullParameter(parcel, "parcel");
|
|
parcel.writeString(this.name);
|
|
parcel.writeParcelable(this.emoji, i);
|
|
parcel.writeString(this.description);
|
|
}
|
|
}
|
|
|
|
private Benefit() {
|
|
}
|
|
|
|
public /* synthetic */ Benefit(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public boolean equals(Object obj) {
|
|
if (obj instanceof Benefit) {
|
|
Benefit benefit = (Benefit) obj;
|
|
if (m.areEqual(getName(), benefit.getName()) && m.areEqual(getDescription(), benefit.getDescription())) {
|
|
Emoji emoji = getEmoji();
|
|
String str = null;
|
|
if (!(emoji instanceof ModelEmojiCustom)) {
|
|
emoji = null;
|
|
}
|
|
ModelEmojiCustom modelEmojiCustom = (ModelEmojiCustom) emoji;
|
|
Long valueOf = modelEmojiCustom != null ? Long.valueOf(modelEmojiCustom.getId()) : null;
|
|
Emoji emoji2 = benefit.getEmoji();
|
|
if (!(emoji2 instanceof ModelEmojiCustom)) {
|
|
emoji2 = null;
|
|
}
|
|
ModelEmojiCustom modelEmojiCustom2 = (ModelEmojiCustom) emoji2;
|
|
if (m.areEqual(valueOf, modelEmojiCustom2 != null ? Long.valueOf(modelEmojiCustom2.getId()) : null)) {
|
|
Emoji emoji3 = getEmoji();
|
|
if (!(emoji3 instanceof ModelEmojiUnicode)) {
|
|
emoji3 = null;
|
|
}
|
|
ModelEmojiUnicode modelEmojiUnicode = (ModelEmojiUnicode) emoji3;
|
|
String surrogates = modelEmojiUnicode != null ? modelEmojiUnicode.getSurrogates() : null;
|
|
Emoji emoji4 = benefit.getEmoji();
|
|
if (!(emoji4 instanceof ModelEmojiUnicode)) {
|
|
emoji4 = null;
|
|
}
|
|
ModelEmojiUnicode modelEmojiUnicode2 = (ModelEmojiUnicode) emoji4;
|
|
if (modelEmojiUnicode2 != null) {
|
|
str = modelEmojiUnicode2.getSurrogates();
|
|
}
|
|
if (m.areEqual(surrogates, str)) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public abstract String getDescription();
|
|
|
|
public abstract Emoji getEmoji();
|
|
|
|
public abstract String getName();
|
|
|
|
public abstract GuildRoleSubscriptionBenefit toGuildRoleSubscriptionBenefit();
|
|
}
|