package fr.xephi.authme.command; import java.util.List; /** * Result of a command mapping by {@link CommandHandler}. An object of this class represents a successful mapping * as well as erroneous ones, as communicated with {@link FoundResultStatus}. *

* Fields other than {@link FoundResultStatus} are available depending, among other factors, on the status: *

*/ public class FoundCommandResult { /** * The command description instance. */ private final CommandDescription commandDescription; /** * The labels used to invoke the command. This may be different for the same {@link ExecutableCommand} instance * if multiple labels have been defined, e.g. "/authme register" and "/authme reg". */ private final List labels; /** The command arguments. */ private final List arguments; /** The difference between the matched command and the supplied labels. */ private final double difference; /** The status of the result (see class description). */ private final FoundResultStatus resultStatus; /** * Constructor. * * @param commandDescription The command description. * @param labels The labels used to access the command. * @param arguments The command arguments. * @param difference The difference between the supplied labels and the matched command. * @param resultStatus The status of the result. */ public FoundCommandResult(CommandDescription commandDescription, List labels, List arguments, double difference, FoundResultStatus resultStatus) { this.commandDescription = commandDescription; this.labels = labels; this.arguments = arguments; this.difference = difference; this.resultStatus = resultStatus; } public CommandDescription getCommandDescription() { return this.commandDescription; } public List getArguments() { return this.arguments; } public List getLabels() { return this.labels; } public double getDifference() { return difference; } public FoundResultStatus getResultStatus() { return resultStatus; } }