discord-jadx/app/src/main/java/com/discord/widgets/hubs/HubDescriptionState.java

146 lines
5.3 KiB
Java

package com.discord.widgets.hubs;
import b.d.b.a.a;
import com.discord.api.channel.Channel;
import com.discord.api.channel.ChannelUtils;
import com.discord.api.directory.DirectoryEntryGuild;
import com.discord.models.hubs.DirectoryEntryCategory;
import com.discord.stores.utilities.Default;
import com.discord.stores.utilities.RestCallState;
import d0.z.d.m;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: WidgetHubDescriptionViewModel.kt */
/* loaded from: classes2.dex */
public final class HubDescriptionState {
private final RestCallState<DirectoryEntryGuild> addServerAsync;
private final Channel channel;
private final String guildName;
private final Integer primaryCategoryId;
public HubDescriptionState() {
this(null, null, null, null, 15, null);
}
public HubDescriptionState(Channel channel, Integer num, String str, RestCallState<DirectoryEntryGuild> restCallState) {
m.checkNotNullParameter(str, "guildName");
m.checkNotNullParameter(restCallState, "addServerAsync");
this.channel = channel;
this.primaryCategoryId = num;
this.guildName = str;
this.addServerAsync = restCallState;
}
public /* synthetic */ HubDescriptionState(Channel channel, Integer num, String str, RestCallState restCallState, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? null : channel, (i & 2) != 0 ? null : num, (i & 4) != 0 ? "" : str, (i & 8) != 0 ? Default.INSTANCE : restCallState);
}
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ HubDescriptionState copy$default(HubDescriptionState hubDescriptionState, Channel channel, Integer num, String str, RestCallState restCallState, int i, Object obj) {
if ((i & 1) != 0) {
channel = hubDescriptionState.channel;
}
if ((i & 2) != 0) {
num = hubDescriptionState.primaryCategoryId;
}
if ((i & 4) != 0) {
str = hubDescriptionState.guildName;
}
if ((i & 8) != 0) {
restCallState = hubDescriptionState.addServerAsync;
}
return hubDescriptionState.copy(channel, num, str, restCallState);
}
public final Channel component1() {
return this.channel;
}
public final Integer component2() {
return this.primaryCategoryId;
}
public final String component3() {
return this.guildName;
}
public final RestCallState<DirectoryEntryGuild> component4() {
return this.addServerAsync;
}
public final HubDescriptionState copy(Channel channel, Integer num, String str, RestCallState<DirectoryEntryGuild> restCallState) {
m.checkNotNullParameter(str, "guildName");
m.checkNotNullParameter(restCallState, "addServerAsync");
return new HubDescriptionState(channel, num, str, restCallState);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof HubDescriptionState)) {
return false;
}
HubDescriptionState hubDescriptionState = (HubDescriptionState) obj;
return m.areEqual(this.channel, hubDescriptionState.channel) && m.areEqual(this.primaryCategoryId, hubDescriptionState.primaryCategoryId) && m.areEqual(this.guildName, hubDescriptionState.guildName) && m.areEqual(this.addServerAsync, hubDescriptionState.addServerAsync);
}
public final RestCallState<DirectoryEntryGuild> getAddServerAsync() {
return this.addServerAsync;
}
public final Channel getChannel() {
return this.channel;
}
public final String getGuildName() {
return this.guildName;
}
public final Integer getPrimaryCategoryId() {
return this.primaryCategoryId;
}
public final DirectoryEntryCategory getSelectedCategory() {
Integer num = this.primaryCategoryId;
if (num == null) {
return null;
}
int intValue = num.intValue();
DirectoryEntryCategory.Companion companion = DirectoryEntryCategory.Companion;
Channel channel = this.channel;
boolean z2 = true;
if (channel == null || !ChannelUtils.v(channel)) {
z2 = false;
}
return companion.findByKey(intValue, z2);
}
public int hashCode() {
Channel channel = this.channel;
int i = 0;
int hashCode = (channel != null ? channel.hashCode() : 0) * 31;
Integer num = this.primaryCategoryId;
int hashCode2 = (hashCode + (num != null ? num.hashCode() : 0)) * 31;
String str = this.guildName;
int hashCode3 = (hashCode2 + (str != null ? str.hashCode() : 0)) * 31;
RestCallState<DirectoryEntryGuild> restCallState = this.addServerAsync;
if (restCallState != null) {
i = restCallState.hashCode();
}
return hashCode3 + i;
}
public String toString() {
StringBuilder R = a.R("HubDescriptionState(channel=");
R.append(this.channel);
R.append(", primaryCategoryId=");
R.append(this.primaryCategoryId);
R.append(", guildName=");
R.append(this.guildName);
R.append(", addServerAsync=");
R.append(this.addServerAsync);
R.append(")");
return R.toString();
}
}