Class TreeExecutionResult<S extends CommandSource>
java.lang.Object
studio.mevera.imperat.command.tree.TreeExecutionResult<S>
- Type Parameters:
S- the source type
Represents the result of a direct tree execution.
This replaces the old
CommandPathSearch by combining
the search and execution into a single step.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe status of a tree execution. -
Method Summary
Modifier and TypeMethodDescription@NotNull CommandPathway<S>@Nullable PermissionHolder@Nullable ExecutionContext<S>@Nullable CommandPathway<S>@NotNull List<ParseResult<S>>@NotNull TreeExecutionResult.Statusbooleanstatic <S extends CommandSource>
TreeExecutionResult<S>noMatch(@Nullable CommandPathway<S> closestUsage, @NotNull Command<S> lastCommand) Creates a result indicating no matching pathway was found.static <S extends CommandSource>
TreeExecutionResult<S>permissionDenied(@Nullable CommandPathway<S> closestUsage, @Nullable PermissionHolder deniedPermissionHolder, @NotNull Command<S> lastCommand) Creates a result indicating permission was denied.static <S extends CommandSource>
TreeExecutionResult<S>success(@NotNull ExecutionContext<S> executionContext, @NotNull CommandPathway<S> closestUsage, @NotNull CommandPathway<S> matchedPathway, @NotNull Command<S> lastCommand, @NotNull List<ParseResult<S>> parsedArguments) Creates a successful execution result.
-
Method Details
-
success
public static <S extends CommandSource> TreeExecutionResult<S> success(@NotNull @NotNull ExecutionContext<S> executionContext, @NotNull @NotNull CommandPathway<S> closestUsage, @NotNull @NotNull CommandPathway<S> matchedPathway, @NotNull @NotNull Command<S> lastCommand, @NotNull @NotNull List<ParseResult<S>> parsedArguments) Creates a successful execution result. -
permissionDenied
public static <S extends CommandSource> TreeExecutionResult<S> permissionDenied(@Nullable @Nullable CommandPathway<S> closestUsage, @Nullable @Nullable PermissionHolder deniedPermissionHolder, @NotNull @NotNull Command<S> lastCommand) Creates a result indicating permission was denied. -
noMatch
public static <S extends CommandSource> TreeExecutionResult<S> noMatch(@Nullable @Nullable CommandPathway<S> closestUsage, @NotNull @NotNull Command<S> lastCommand) Creates a result indicating no matching pathway was found. -
getStatus
-
getExecutionContext
-
getMatchedPathway
-
getClosestUsage
-
getDeniedPermissionHolder
-
getLastCommand
-
getParsedArguments
-
isSuccess
public boolean isSuccess()
-