134 lines
5.7 KiB
Java
134 lines
5.7 KiB
Java
package com.discord.widgets.chat.input.models;
|
|
|
|
import c.d.b.a.a;
|
|
import com.discord.api.commands.ApplicationCommandType;
|
|
import com.discord.api.commands.CommandChoice;
|
|
import com.discord.models.commands.ApplicationCommandOption;
|
|
import d0.z.d.m;
|
|
import java.util.List;
|
|
import kotlin.ranges.IntRange;
|
|
/* compiled from: InputSelectionModel.kt */
|
|
public final class InputSelectionModel {
|
|
private final VerifiedCommandMentionInputModel inputModel;
|
|
private final ApplicationCommandOption selectedCommandOption;
|
|
private final IntRange selection;
|
|
|
|
public InputSelectionModel(VerifiedCommandMentionInputModel verifiedCommandMentionInputModel, ApplicationCommandOption applicationCommandOption, IntRange intRange) {
|
|
m.checkNotNullParameter(verifiedCommandMentionInputModel, "inputModel");
|
|
m.checkNotNullParameter(intRange, "selection");
|
|
this.inputModel = verifiedCommandMentionInputModel;
|
|
this.selectedCommandOption = applicationCommandOption;
|
|
this.selection = intRange;
|
|
}
|
|
|
|
public static /* synthetic */ InputSelectionModel copy$default(InputSelectionModel inputSelectionModel, VerifiedCommandMentionInputModel verifiedCommandMentionInputModel, ApplicationCommandOption applicationCommandOption, IntRange intRange, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
verifiedCommandMentionInputModel = inputSelectionModel.inputModel;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
applicationCommandOption = inputSelectionModel.selectedCommandOption;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
intRange = inputSelectionModel.selection;
|
|
}
|
|
return inputSelectionModel.copy(verifiedCommandMentionInputModel, applicationCommandOption, intRange);
|
|
}
|
|
|
|
public final VerifiedCommandMentionInputModel component1() {
|
|
return this.inputModel;
|
|
}
|
|
|
|
public final ApplicationCommandOption component2() {
|
|
return this.selectedCommandOption;
|
|
}
|
|
|
|
public final IntRange component3() {
|
|
return this.selection;
|
|
}
|
|
|
|
public final InputSelectionModel copy(VerifiedCommandMentionInputModel verifiedCommandMentionInputModel, ApplicationCommandOption applicationCommandOption, IntRange intRange) {
|
|
m.checkNotNullParameter(verifiedCommandMentionInputModel, "inputModel");
|
|
m.checkNotNullParameter(intRange, "selection");
|
|
return new InputSelectionModel(verifiedCommandMentionInputModel, applicationCommandOption, intRange);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof InputSelectionModel)) {
|
|
return false;
|
|
}
|
|
InputSelectionModel inputSelectionModel = (InputSelectionModel) obj;
|
|
return m.areEqual(this.inputModel, inputSelectionModel.inputModel) && m.areEqual(this.selectedCommandOption, inputSelectionModel.selectedCommandOption) && m.areEqual(this.selection, inputSelectionModel.selection);
|
|
}
|
|
|
|
public final VerifiedCommandMentionInputModel getInputModel() {
|
|
return this.inputModel;
|
|
}
|
|
|
|
public final ApplicationCommandOption getSelectedCommandOption() {
|
|
return this.selectedCommandOption;
|
|
}
|
|
|
|
public final IntRange getSelection() {
|
|
return this.selection;
|
|
}
|
|
|
|
public final boolean hasSelectedFreeformInputOption() {
|
|
ApplicationCommandOption applicationCommandOption;
|
|
if (this.inputModel.getInputCommandContext().isCommand() && (applicationCommandOption = this.selectedCommandOption) != null) {
|
|
List<CommandChoice> choices = applicationCommandOption.getChoices();
|
|
boolean z2 = choices != null && (choices.isEmpty() ^ true);
|
|
ApplicationCommandType type = this.selectedCommandOption.getType();
|
|
if (z2 || !(type == ApplicationCommandType.INTEGER || type == ApplicationCommandType.STRING)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final boolean hasSelectedOptionWithChoices() {
|
|
if (this.inputModel.getInputCommandContext().isCommand()) {
|
|
ApplicationCommandOption applicationCommandOption = this.selectedCommandOption;
|
|
ApplicationCommandType applicationCommandType = null;
|
|
List<CommandChoice> choices = applicationCommandOption != null ? applicationCommandOption.getChoices() : null;
|
|
if (!(choices == null || choices.isEmpty())) {
|
|
return true;
|
|
}
|
|
ApplicationCommandOption applicationCommandOption2 = this.selectedCommandOption;
|
|
if (applicationCommandOption2 != null) {
|
|
applicationCommandType = applicationCommandOption2.getType();
|
|
}
|
|
if (applicationCommandType == ApplicationCommandType.BOOLEAN) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public int hashCode() {
|
|
VerifiedCommandMentionInputModel verifiedCommandMentionInputModel = this.inputModel;
|
|
int i = 0;
|
|
int hashCode = (verifiedCommandMentionInputModel != null ? verifiedCommandMentionInputModel.hashCode() : 0) * 31;
|
|
ApplicationCommandOption applicationCommandOption = this.selectedCommandOption;
|
|
int hashCode2 = (hashCode + (applicationCommandOption != null ? applicationCommandOption.hashCode() : 0)) * 31;
|
|
IntRange intRange = this.selection;
|
|
if (intRange != null) {
|
|
i = intRange.hashCode();
|
|
}
|
|
return hashCode2 + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder L = a.L("InputSelectionModel(inputModel=");
|
|
L.append(this.inputModel);
|
|
L.append(", selectedCommandOption=");
|
|
L.append(this.selectedCommandOption);
|
|
L.append(", selection=");
|
|
L.append(this.selection);
|
|
L.append(")");
|
|
return L.toString();
|
|
}
|
|
}
|