109 lines
3.4 KiB
Java
109 lines
3.4 KiB
Java
|
package com.discord.widgets.chat.input.models;
|
||
|
|
||
|
import c.d.b.a.a;
|
||
|
import com.discord.widgets.chat.input.autocomplete.LeadingIdentifier;
|
||
|
import d0.g0.t;
|
||
|
import d0.z.d.m;
|
||
|
/* compiled from: MentionToken.kt */
|
||
|
public final class MentionToken {
|
||
|
private final String formattedToken;
|
||
|
private final boolean isAtStart;
|
||
|
private final LeadingIdentifier leadingIdentifier;
|
||
|
private final String token;
|
||
|
|
||
|
public MentionToken(LeadingIdentifier leadingIdentifier, String str, boolean z2) {
|
||
|
m.checkNotNullParameter(leadingIdentifier, "leadingIdentifier");
|
||
|
m.checkNotNullParameter(str, "token");
|
||
|
this.leadingIdentifier = leadingIdentifier;
|
||
|
this.token = str;
|
||
|
this.isAtStart = z2;
|
||
|
this.formattedToken = t.replaceFirst$default(str, String.valueOf(leadingIdentifier.getIdentifier()), "", false, 4, null);
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ MentionToken copy$default(MentionToken mentionToken, LeadingIdentifier leadingIdentifier, String str, boolean z2, int i, Object obj) {
|
||
|
if ((i & 1) != 0) {
|
||
|
leadingIdentifier = mentionToken.leadingIdentifier;
|
||
|
}
|
||
|
if ((i & 2) != 0) {
|
||
|
str = mentionToken.token;
|
||
|
}
|
||
|
if ((i & 4) != 0) {
|
||
|
z2 = mentionToken.isAtStart;
|
||
|
}
|
||
|
return mentionToken.copy(leadingIdentifier, str, z2);
|
||
|
}
|
||
|
|
||
|
public final LeadingIdentifier component1() {
|
||
|
return this.leadingIdentifier;
|
||
|
}
|
||
|
|
||
|
public final String component2() {
|
||
|
return this.token;
|
||
|
}
|
||
|
|
||
|
public final boolean component3() {
|
||
|
return this.isAtStart;
|
||
|
}
|
||
|
|
||
|
public final MentionToken copy(LeadingIdentifier leadingIdentifier, String str, boolean z2) {
|
||
|
m.checkNotNullParameter(leadingIdentifier, "leadingIdentifier");
|
||
|
m.checkNotNullParameter(str, "token");
|
||
|
return new MentionToken(leadingIdentifier, str, z2);
|
||
|
}
|
||
|
|
||
|
public boolean equals(Object obj) {
|
||
|
if (this == obj) {
|
||
|
return true;
|
||
|
}
|
||
|
if (!(obj instanceof MentionToken)) {
|
||
|
return false;
|
||
|
}
|
||
|
MentionToken mentionToken = (MentionToken) obj;
|
||
|
return m.areEqual(this.leadingIdentifier, mentionToken.leadingIdentifier) && m.areEqual(this.token, mentionToken.token) && this.isAtStart == mentionToken.isAtStart;
|
||
|
}
|
||
|
|
||
|
public final String getFormattedToken() {
|
||
|
return this.formattedToken;
|
||
|
}
|
||
|
|
||
|
public final LeadingIdentifier getLeadingIdentifier() {
|
||
|
return this.leadingIdentifier;
|
||
|
}
|
||
|
|
||
|
public final String getToken() {
|
||
|
return this.token;
|
||
|
}
|
||
|
|
||
|
public int hashCode() {
|
||
|
LeadingIdentifier leadingIdentifier = this.leadingIdentifier;
|
||
|
int i = 0;
|
||
|
int hashCode = (leadingIdentifier != null ? leadingIdentifier.hashCode() : 0) * 31;
|
||
|
String str = this.token;
|
||
|
if (str != null) {
|
||
|
i = str.hashCode();
|
||
|
}
|
||
|
int i2 = (hashCode + i) * 31;
|
||
|
boolean z2 = this.isAtStart;
|
||
|
if (z2) {
|
||
|
z2 = true;
|
||
|
}
|
||
|
int i3 = z2 ? 1 : 0;
|
||
|
int i4 = z2 ? 1 : 0;
|
||
|
int i5 = z2 ? 1 : 0;
|
||
|
return i2 + i3;
|
||
|
}
|
||
|
|
||
|
public final boolean isAtStart() {
|
||
|
return this.isAtStart;
|
||
|
}
|
||
|
|
||
|
public String toString() {
|
||
|
StringBuilder K = a.K("MentionToken(leadingIdentifier=");
|
||
|
K.append(this.leadingIdentifier);
|
||
|
K.append(", token=");
|
||
|
K.append(this.token);
|
||
|
K.append(", isAtStart=");
|
||
|
return a.F(K, this.isAtStart, ")");
|
||
|
}
|
||
|
}
|