366 lines
14 KiB
Java
366 lines
14 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 channelName;
|
|
private final String description;
|
|
private final Emoji emoji;
|
|
|
|
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(), parcel.readLong(), (Emoji) parcel.readParcelable(ChannelBenefit.class.getClassLoader()), parcel.readString(), parcel.readInt() != 0 ? Integer.valueOf(parcel.readInt()) : null);
|
|
}
|
|
|
|
@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, long j, Emoji emoji, String str2, @DrawableRes Integer num) {
|
|
super(null);
|
|
m.checkNotNullParameter(str, "channelName");
|
|
m.checkNotNullParameter(emoji, "emoji");
|
|
this.channelName = str;
|
|
this.channelId = j;
|
|
this.emoji = emoji;
|
|
this.description = str2;
|
|
this.channelIconResId = num;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ ChannelBenefit(String str, long j, Emoji emoji, String str2, Integer num, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(str, j, emoji, (i & 8) != 0 ? null : str2, (i & 16) != 0 ? null : num);
|
|
}
|
|
|
|
public static /* synthetic */ ChannelBenefit copy$default(ChannelBenefit channelBenefit, String str, long j, Emoji emoji, String str2, Integer num, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
str = channelBenefit.channelName;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
j = channelBenefit.channelId;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
emoji = channelBenefit.emoji;
|
|
}
|
|
if ((i & 8) != 0) {
|
|
str2 = channelBenefit.description;
|
|
}
|
|
if ((i & 16) != 0) {
|
|
num = channelBenefit.channelIconResId;
|
|
}
|
|
return channelBenefit.copy(str, j, emoji, str2, num);
|
|
}
|
|
|
|
public final String component1() {
|
|
return this.channelName;
|
|
}
|
|
|
|
public final long component2() {
|
|
return this.channelId;
|
|
}
|
|
|
|
public final Emoji component3() {
|
|
return this.emoji;
|
|
}
|
|
|
|
public final String component4() {
|
|
return this.description;
|
|
}
|
|
|
|
public final Integer component5() {
|
|
return this.channelIconResId;
|
|
}
|
|
|
|
public final ChannelBenefit copy(String str, long j, Emoji emoji, String str2, @DrawableRes Integer num) {
|
|
m.checkNotNullParameter(str, "channelName");
|
|
m.checkNotNullParameter(emoji, "emoji");
|
|
return new ChannelBenefit(str, j, emoji, str2, num);
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof ChannelBenefit)) {
|
|
return false;
|
|
}
|
|
ChannelBenefit channelBenefit = (ChannelBenefit) obj;
|
|
return m.areEqual(this.channelName, channelBenefit.channelName) && this.channelId == channelBenefit.channelId && m.areEqual(this.emoji, channelBenefit.emoji) && m.areEqual(this.description, channelBenefit.description) && m.areEqual(this.channelIconResId, channelBenefit.channelIconResId);
|
|
}
|
|
|
|
public final Integer getChannelIconResId() {
|
|
return this.channelIconResId;
|
|
}
|
|
|
|
public final long getChannelId() {
|
|
return this.channelId;
|
|
}
|
|
|
|
public final String getChannelName() {
|
|
return this.channelName;
|
|
}
|
|
|
|
public final String getDescription() {
|
|
return this.description;
|
|
}
|
|
|
|
public final Emoji getEmoji() {
|
|
return this.emoji;
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public int hashCode() {
|
|
String str = this.channelName;
|
|
int i = 0;
|
|
int a = (b.a(this.channelId) + ((str != null ? str.hashCode() : 0) * 31)) * 31;
|
|
Emoji emoji = this.emoji;
|
|
int hashCode = (a + (emoji != null ? emoji.hashCode() : 0)) * 31;
|
|
String str2 = this.description;
|
|
int hashCode2 = (hashCode + (str2 != null ? str2.hashCode() : 0)) * 31;
|
|
Integer num = this.channelIconResId;
|
|
if (num != null) {
|
|
i = num.hashCode();
|
|
}
|
|
return hashCode2 + i;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public GuildRoleSubscriptionBenefit toGuildRoleSubscriptionBenefit() {
|
|
Emoji emoji = this.emoji;
|
|
String str = null;
|
|
if (!(emoji instanceof ModelEmojiCustom)) {
|
|
emoji = null;
|
|
}
|
|
ModelEmojiCustom modelEmojiCustom = (ModelEmojiCustom) emoji;
|
|
Long valueOf = modelEmojiCustom != null ? Long.valueOf(modelEmojiCustom.getId()) : null;
|
|
Emoji emoji2 = this.emoji;
|
|
if (!(emoji2 instanceof ModelEmojiUnicode)) {
|
|
emoji2 = null;
|
|
}
|
|
ModelEmojiUnicode modelEmojiUnicode = (ModelEmojiUnicode) emoji2;
|
|
if (modelEmojiUnicode != null) {
|
|
str = modelEmojiUnicode.getSurrogates();
|
|
}
|
|
return new GuildRoleSubscriptionBenefit(valueOf, str, this.channelName, GuildRoleSubscriptionBenefitType.CHANNEL, this.description, Long.valueOf(this.channelId));
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public String toString() {
|
|
StringBuilder P = a.P("ChannelBenefit(channelName=");
|
|
P.append(this.channelName);
|
|
P.append(", channelId=");
|
|
P.append(this.channelId);
|
|
P.append(", emoji=");
|
|
P.append(this.emoji);
|
|
P.append(", description=");
|
|
P.append(this.description);
|
|
P.append(", channelIconResId=");
|
|
return a.E(P, this.channelIconResId, ")");
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
int i2;
|
|
m.checkNotNullParameter(parcel, "parcel");
|
|
parcel.writeString(this.channelName);
|
|
parcel.writeLong(this.channelId);
|
|
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);
|
|
}
|
|
}
|
|
|
|
/* 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.name;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
emoji = intangibleBenefit.emoji;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
str2 = intangibleBenefit.description;
|
|
}
|
|
return intangibleBenefit.copy(str, emoji, str2);
|
|
}
|
|
|
|
public final String component1() {
|
|
return this.name;
|
|
}
|
|
|
|
public final Emoji component2() {
|
|
return this.emoji;
|
|
}
|
|
|
|
public final String component3() {
|
|
return this.description;
|
|
}
|
|
|
|
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 // java.lang.Object
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof IntangibleBenefit)) {
|
|
return false;
|
|
}
|
|
IntangibleBenefit intangibleBenefit = (IntangibleBenefit) obj;
|
|
return m.areEqual(this.name, intangibleBenefit.name) && m.areEqual(this.emoji, intangibleBenefit.emoji) && m.areEqual(this.description, intangibleBenefit.description);
|
|
}
|
|
|
|
public final String getDescription() {
|
|
return this.description;
|
|
}
|
|
|
|
public final Emoji getEmoji() {
|
|
return this.emoji;
|
|
}
|
|
|
|
public final String getName() {
|
|
return this.name;
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public int hashCode() {
|
|
String str = this.name;
|
|
int i = 0;
|
|
int hashCode = (str != null ? str.hashCode() : 0) * 31;
|
|
Emoji emoji = this.emoji;
|
|
int hashCode2 = (hashCode + (emoji != null ? emoji.hashCode() : 0)) * 31;
|
|
String str2 = this.description;
|
|
if (str2 != null) {
|
|
i = str2.hashCode();
|
|
}
|
|
return hashCode2 + i;
|
|
}
|
|
|
|
@Override // com.discord.widgets.guild_role_subscriptions.tier.model.Benefit
|
|
public GuildRoleSubscriptionBenefit toGuildRoleSubscriptionBenefit() {
|
|
Emoji emoji = this.emoji;
|
|
String str = null;
|
|
if (!(emoji instanceof ModelEmojiCustom)) {
|
|
emoji = null;
|
|
}
|
|
ModelEmojiCustom modelEmojiCustom = (ModelEmojiCustom) emoji;
|
|
Long valueOf = modelEmojiCustom != null ? Long.valueOf(modelEmojiCustom.getId()) : null;
|
|
Emoji emoji2 = this.emoji;
|
|
if (!(emoji2 instanceof ModelEmojiUnicode)) {
|
|
emoji2 = null;
|
|
}
|
|
ModelEmojiUnicode modelEmojiUnicode = (ModelEmojiUnicode) emoji2;
|
|
if (modelEmojiUnicode != null) {
|
|
str = modelEmojiUnicode.getSurrogates();
|
|
}
|
|
return new GuildRoleSubscriptionBenefit(valueOf, str, this.name, GuildRoleSubscriptionBenefitType.INTANGIBLE, this.description, null);
|
|
}
|
|
|
|
@Override // java.lang.Object
|
|
public String toString() {
|
|
StringBuilder P = a.P("IntangibleBenefit(name=");
|
|
P.append(this.name);
|
|
P.append(", emoji=");
|
|
P.append(this.emoji);
|
|
P.append(", description=");
|
|
return a.H(P, this.description, ")");
|
|
}
|
|
|
|
@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();
|
|
}
|
|
|
|
public abstract GuildRoleSubscriptionBenefit toGuildRoleSubscriptionBenefit();
|
|
}
|