135 lines
4.4 KiB
Java
135 lines
4.4 KiB
Java
package com.discord.widgets.chat.list.entries;
|
|
|
|
import c.d.b.a.a;
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.models.domain.ModelMessage;
|
|
import com.discord.models.guild.Guild;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: MessageHeaderEntry.kt */
|
|
public final class MessageHeaderEntry extends ChatListEntry {
|
|
public static final Companion Companion = new Companion(null);
|
|
private final String channelName;
|
|
private final String key = String.valueOf(getType());
|
|
private final ModelMessage message;
|
|
private final String text;
|
|
private final int type = 17;
|
|
|
|
/* compiled from: MessageHeaderEntry.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final MessageHeaderEntry create(ModelMessage modelMessage, Channel channel, Guild guild) {
|
|
m.checkNotNullParameter(modelMessage, "message");
|
|
String str = null;
|
|
String name = guild != null ? guild.getName() : null;
|
|
if (channel != null) {
|
|
str = AnimatableValueParser.y0(channel);
|
|
}
|
|
return new MessageHeaderEntry(modelMessage, name, str);
|
|
}
|
|
}
|
|
|
|
public MessageHeaderEntry(ModelMessage modelMessage, String str, String str2) {
|
|
m.checkNotNullParameter(modelMessage, "message");
|
|
this.message = modelMessage;
|
|
this.text = str;
|
|
this.channelName = str2;
|
|
}
|
|
|
|
public static /* synthetic */ MessageHeaderEntry copy$default(MessageHeaderEntry messageHeaderEntry, ModelMessage modelMessage, String str, String str2, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
modelMessage = messageHeaderEntry.message;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
str = messageHeaderEntry.text;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
str2 = messageHeaderEntry.channelName;
|
|
}
|
|
return messageHeaderEntry.copy(modelMessage, str, str2);
|
|
}
|
|
|
|
public static final MessageHeaderEntry create(ModelMessage modelMessage, Channel channel, Guild guild) {
|
|
return Companion.create(modelMessage, channel, guild);
|
|
}
|
|
|
|
public final ModelMessage component1() {
|
|
return this.message;
|
|
}
|
|
|
|
public final String component2() {
|
|
return this.text;
|
|
}
|
|
|
|
public final String component3() {
|
|
return this.channelName;
|
|
}
|
|
|
|
public final MessageHeaderEntry copy(ModelMessage modelMessage, String str, String str2) {
|
|
m.checkNotNullParameter(modelMessage, "message");
|
|
return new MessageHeaderEntry(modelMessage, str, str2);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof MessageHeaderEntry)) {
|
|
return false;
|
|
}
|
|
MessageHeaderEntry messageHeaderEntry = (MessageHeaderEntry) obj;
|
|
return m.areEqual(this.message, messageHeaderEntry.message) && m.areEqual(this.text, messageHeaderEntry.text) && m.areEqual(this.channelName, messageHeaderEntry.channelName);
|
|
}
|
|
|
|
public final String getChannelName() {
|
|
return this.channelName;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload, com.discord.utilities.recycler.DiffKeyProvider
|
|
public String getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public final ModelMessage getMessage() {
|
|
return this.message;
|
|
}
|
|
|
|
public final String getText() {
|
|
return this.text;
|
|
}
|
|
|
|
@Override // com.discord.utilities.mg_recycler.MGRecyclerDataPayload
|
|
public int getType() {
|
|
return this.type;
|
|
}
|
|
|
|
public int hashCode() {
|
|
ModelMessage modelMessage = this.message;
|
|
int i = 0;
|
|
int hashCode = (modelMessage != null ? modelMessage.hashCode() : 0) * 31;
|
|
String str = this.text;
|
|
int hashCode2 = (hashCode + (str != null ? str.hashCode() : 0)) * 31;
|
|
String str2 = this.channelName;
|
|
if (str2 != null) {
|
|
i = str2.hashCode();
|
|
}
|
|
return hashCode2 + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder L = a.L("MessageHeaderEntry(message=");
|
|
L.append(this.message);
|
|
L.append(", text=");
|
|
L.append(this.text);
|
|
L.append(", channelName=");
|
|
return a.D(L, this.channelName, ")");
|
|
}
|
|
}
|