discord-jadx/app/src/main/java/com/discord/widgets/guildscheduledevent/GuildScheduledEventLocation...

195 lines
6.8 KiB
Java

package com.discord.widgets.guildscheduledevent;
import androidx.annotation.DrawableRes;
import c.d.b.a.a;
import com.discord.R;
import com.discord.api.channel.Channel;
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
import com.discord.api.guildscheduledevent.GuildScheduledEventEntityMetadata;
import com.discord.api.guildscheduledevent.GuildScheduledEventEntityType;
import d0.z.d.m;
import kotlin.NoWhenBranchMatchedException;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: GuildScheduledEventLocationInfo.kt */
public abstract class GuildScheduledEventLocationInfo {
public static final Companion Companion = new Companion(null);
/* compiled from: GuildScheduledEventLocationInfo.kt */
public static final class ChannelLocation extends GuildScheduledEventLocationInfo {
private final Channel channel;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ChannelLocation(Channel channel) {
super(null);
m.checkNotNullParameter(channel, "channel");
this.channel = channel;
}
public static /* synthetic */ ChannelLocation copy$default(ChannelLocation channelLocation, Channel channel, int i, Object obj) {
if ((i & 1) != 0) {
channel = channelLocation.channel;
}
return channelLocation.copy(channel);
}
public final Channel component1() {
return this.channel;
}
public final ChannelLocation copy(Channel channel) {
m.checkNotNullParameter(channel, "channel");
return new ChannelLocation(channel);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof ChannelLocation) && m.areEqual(this.channel, ((ChannelLocation) obj).channel);
}
return true;
}
public final Channel getChannel() {
return this.channel;
}
public int hashCode() {
Channel channel = this.channel;
if (channel != null) {
return channel.hashCode();
}
return 0;
}
public String toString() {
StringBuilder L = a.L("ChannelLocation(channel=");
L.append(this.channel);
L.append(")");
return L.toString();
}
}
/* compiled from: GuildScheduledEventLocationInfo.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final GuildScheduledEventLocationInfo buildLocationInfo(GuildScheduledEvent guildScheduledEvent, Channel channel) {
String str;
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
if (guildScheduledEvent.e() == GuildScheduledEventEntityType.EXTERNAL) {
GuildScheduledEventEntityMetadata d = guildScheduledEvent.d();
if (d == null || (str = d.a()) == null) {
str = "";
}
return new ExternalLocation(str);
}
m.checkNotNull(channel);
return new ChannelLocation(channel);
}
public final GuildScheduledEventLocationInfo buildLocationInfo(GuildScheduledEventModel guildScheduledEventModel, Channel channel) {
String str;
m.checkNotNullParameter(guildScheduledEventModel, "guildScheduledEventModel");
if (guildScheduledEventModel.getEntityType() == GuildScheduledEventEntityType.EXTERNAL) {
GuildScheduledEventEntityMetadata entityMetadata = guildScheduledEventModel.getEntityMetadata();
if (entityMetadata == null || (str = entityMetadata.a()) == null) {
str = "";
}
return new ExternalLocation(str);
}
m.checkNotNull(channel);
return new ChannelLocation(channel);
}
}
/* compiled from: GuildScheduledEventLocationInfo.kt */
public static final class ExternalLocation extends GuildScheduledEventLocationInfo {
private final String location;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ExternalLocation(String str) {
super(null);
m.checkNotNullParameter(str, "location");
this.location = str;
}
public static /* synthetic */ ExternalLocation copy$default(ExternalLocation externalLocation, String str, int i, Object obj) {
if ((i & 1) != 0) {
str = externalLocation.location;
}
return externalLocation.copy(str);
}
public final String component1() {
return this.location;
}
public final ExternalLocation copy(String str) {
m.checkNotNullParameter(str, "location");
return new ExternalLocation(str);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof ExternalLocation) && m.areEqual(this.location, ((ExternalLocation) obj).location);
}
return true;
}
public final String getLocation() {
return this.location;
}
public int hashCode() {
String str = this.location;
if (str != null) {
return str.hashCode();
}
return 0;
}
public String toString() {
return a.D(a.L("ExternalLocation(location="), this.location, ")");
}
}
private GuildScheduledEventLocationInfo() {
}
public /* synthetic */ GuildScheduledEventLocationInfo(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
@DrawableRes
private final int getChannelIcon(Channel channel) {
int A = channel.A();
return (A == 2 || A != 13) ? R.drawable.ic_channel_voice : R.drawable.ic_stage_20dp;
}
@DrawableRes
public final int getLocationIcon() {
if (this instanceof ChannelLocation) {
return getChannelIcon(((ChannelLocation) this).getChannel());
}
if (this instanceof ExternalLocation) {
return R.drawable.ic_location_24dp;
}
throw new NoWhenBranchMatchedException();
}
public final String getLocationName() {
if (this instanceof ChannelLocation) {
String m = ((ChannelLocation) this).getChannel().m();
return m != null ? m : "";
} else if (this instanceof ExternalLocation) {
return ((ExternalLocation) this).getLocation();
} else {
throw new NoWhenBranchMatchedException();
}
}
}