discord-jadx/app/src/main/java/com/discord/widgets/guilds/invite/GuildInvite.java

206 lines
7.5 KiB
Java

package com.discord.widgets.guilds.invite;
import a0.a.a.b;
import b.d.b.a.a;
import com.discord.api.channel.Channel;
import com.discord.api.guild.Guild;
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
import com.discord.api.user.User;
import com.discord.models.domain.ModelInvite;
import com.discord.models.invite.InviteUtils;
import d0.z.d.m;
import java.io.Serializable;
import kotlin.NoWhenBranchMatchedException;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: GuildInvite.kt */
public final class GuildInvite implements Serializable {
public static final Companion Companion = new Companion(null);
private final Long channelId;
private final long expirationTimeMs;
private final Long guildId;
private final Long guildScheduledEventId;
private final String inviteCode;
private final Long inviterId;
private final boolean isStaticInvite;
/* compiled from: GuildInvite.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final GuildInvite createFromModelInvite(ModelInvite modelInvite) {
boolean z2;
m.checkNotNullParameter(modelInvite, "invite");
GuildScheduledEvent guildScheduledEvent = modelInvite.getGuildScheduledEvent();
Long l = null;
if ((guildScheduledEvent != null ? guildScheduledEvent.b() : null) != null) {
GuildScheduledEvent guildScheduledEvent2 = modelInvite.getGuildScheduledEvent();
Long b2 = guildScheduledEvent2 != null ? guildScheduledEvent2.b() : null;
Channel channel = modelInvite.getChannel();
z2 = m.areEqual(b2, channel != null ? Long.valueOf(channel.h()) : null);
} else {
z2 = true;
}
String str = modelInvite.code;
m.checkNotNullExpressionValue(str, "invite.code");
Guild guild = modelInvite.guild;
Long valueOf = guild != null ? Long.valueOf(guild.r()) : null;
Channel channel2 = modelInvite.getChannel();
Long valueOf2 = channel2 != null ? Long.valueOf(channel2.h()) : null;
User inviter = modelInvite.getInviter();
Long valueOf3 = inviter != null ? Long.valueOf(inviter.i()) : null;
boolean isStatic = modelInvite.isStatic();
long expirationTime = modelInvite.getExpirationTime();
if (z2) {
GuildScheduledEvent guildScheduledEvent3 = modelInvite.getGuildScheduledEvent();
if (guildScheduledEvent3 != null) {
l = Long.valueOf(guildScheduledEvent3.i());
}
} else if (z2) {
throw new NoWhenBranchMatchedException();
}
return new GuildInvite(str, valueOf, valueOf2, valueOf3, isStatic, expirationTime, l);
}
}
public GuildInvite(String str, Long l, Long l2, Long l3, boolean z2, long j, Long l4) {
m.checkNotNullParameter(str, "inviteCode");
this.inviteCode = str;
this.guildId = l;
this.channelId = l2;
this.inviterId = l3;
this.isStaticInvite = z2;
this.expirationTimeMs = j;
this.guildScheduledEventId = l4;
}
public static /* synthetic */ GuildInvite copy$default(GuildInvite guildInvite, String str, Long l, Long l2, Long l3, boolean z2, long j, Long l4, int i, Object obj) {
return guildInvite.copy((i & 1) != 0 ? guildInvite.inviteCode : str, (i & 2) != 0 ? guildInvite.guildId : l, (i & 4) != 0 ? guildInvite.channelId : l2, (i & 8) != 0 ? guildInvite.inviterId : l3, (i & 16) != 0 ? guildInvite.isStaticInvite : z2, (i & 32) != 0 ? guildInvite.expirationTimeMs : j, (i & 64) != 0 ? guildInvite.guildScheduledEventId : l4);
}
public final String component1() {
return this.inviteCode;
}
public final Long component2() {
return this.guildId;
}
public final Long component3() {
return this.channelId;
}
public final Long component4() {
return this.inviterId;
}
public final boolean component5() {
return this.isStaticInvite;
}
public final long component6() {
return this.expirationTimeMs;
}
public final Long component7() {
return this.guildScheduledEventId;
}
public final GuildInvite copy(String str, Long l, Long l2, Long l3, boolean z2, long j, Long l4) {
m.checkNotNullParameter(str, "inviteCode");
return new GuildInvite(str, l, l2, l3, z2, j, l4);
}
@Override // java.lang.Object
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof GuildInvite)) {
return false;
}
GuildInvite guildInvite = (GuildInvite) obj;
return m.areEqual(this.inviteCode, guildInvite.inviteCode) && m.areEqual(this.guildId, guildInvite.guildId) && m.areEqual(this.channelId, guildInvite.channelId) && m.areEqual(this.inviterId, guildInvite.inviterId) && this.isStaticInvite == guildInvite.isStaticInvite && this.expirationTimeMs == guildInvite.expirationTimeMs && m.areEqual(this.guildScheduledEventId, guildInvite.guildScheduledEventId);
}
public final Long getChannelId() {
return this.channelId;
}
public final long getExpirationTimeMs() {
return this.expirationTimeMs;
}
public final Long getGuildId() {
return this.guildId;
}
public final Long getGuildScheduledEventId() {
return this.guildScheduledEventId;
}
public final String getInviteCode() {
return this.inviteCode;
}
public final Long getInviterId() {
return this.inviterId;
}
@Override // java.lang.Object
public int hashCode() {
String str = this.inviteCode;
int i = 0;
int hashCode = (str != null ? str.hashCode() : 0) * 31;
Long l = this.guildId;
int hashCode2 = (hashCode + (l != null ? l.hashCode() : 0)) * 31;
Long l2 = this.channelId;
int hashCode3 = (hashCode2 + (l2 != null ? l2.hashCode() : 0)) * 31;
Long l3 = this.inviterId;
int hashCode4 = (hashCode3 + (l3 != null ? l3.hashCode() : 0)) * 31;
boolean z2 = this.isStaticInvite;
if (z2) {
z2 = true;
}
int i2 = z2 ? 1 : 0;
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int a = (b.a(this.expirationTimeMs) + ((hashCode4 + i2) * 31)) * 31;
Long l4 = this.guildScheduledEventId;
if (l4 != null) {
i = l4.hashCode();
}
return a + i;
}
public final boolean isStaticInvite() {
return this.isStaticInvite;
}
public final String toLink() {
return InviteUtils.INSTANCE.createLinkFromCode(this.inviteCode, this.guildScheduledEventId);
}
@Override // java.lang.Object
public String toString() {
StringBuilder R = a.R("GuildInvite(inviteCode=");
R.append(this.inviteCode);
R.append(", guildId=");
R.append(this.guildId);
R.append(", channelId=");
R.append(this.channelId);
R.append(", inviterId=");
R.append(this.inviterId);
R.append(", isStaticInvite=");
R.append(this.isStaticInvite);
R.append(", expirationTimeMs=");
R.append(this.expirationTimeMs);
R.append(", guildScheduledEventId=");
return a.F(R, this.guildScheduledEventId, ")");
}
}