net.lenni0451.commandlib.ParseResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of CommandLib Show documentation
Show all versions of CommandLib Show documentation
A command lib with a simple and powerful API
The newest version!
package net.lenni0451.commandlib;
import net.lenni0451.commandlib.exceptions.ChainExecutionException;
import java.util.Collections;
import java.util.List;
/**
* Storage for all parsed argument chains.
*
* @param The type of the executor
*/
public class ParseResult {
private final List> parsedChains;
private final List> failedChains;
public ParseResult(final List> parsedChains, final List> failedChains) {
this.parsedChains = parsedChains;
this.failedChains = failedChains;
}
public List> getParsedChains() {
return Collections.unmodifiableList(this.parsedChains);
}
public List> getFailedChains() {
return Collections.unmodifiableList(this.failedChains);
}
public static class ParsedChain {
private final ArgumentChain argumentChain;
private final List matchedArguments;
public ParsedChain(final ArgumentChain argumentChain, final List matchedArguments) {
this.argumentChain = argumentChain;
this.matchedArguments = matchedArguments;
}
public ArgumentChain getArgumentChain() {
return this.argumentChain;
}
public List getMatchedArguments() {
return this.matchedArguments;
}
}
public static class FailedChain {
private final ArgumentChain argumentChain;
private final ChainExecutionException executionException;
public FailedChain(final ArgumentChain argumentChain, final ChainExecutionException executionException) {
this.argumentChain = argumentChain;
this.executionException = executionException;
}
public ArgumentChain getArgumentChain() {
return this.argumentChain;
}
public ChainExecutionException getExecutionException() {
return this.executionException;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy