diff --git a/api/cmdpipe.api b/api/cmdpipe.api index 1662614..be0c14a 100644 --- a/api/cmdpipe.api +++ b/api/cmdpipe.api @@ -45,6 +45,9 @@ public abstract interface class space/iseki/cmdpipe/Cmd$StreamProcessor { public abstract interface class space/iseki/cmdpipe/Cmd$StreamProcessor$Ctx { public abstract fun cmd ()Lspace/iseki/cmdpipe/Cmd; + public fun component1 ()Lspace/iseki/cmdpipe/Cmd; + public fun component2 ()Lspace/iseki/cmdpipe/Cmd$Stdio; + public fun component3 ()Ljava/lang/Object; public fun getCmd ()Lspace/iseki/cmdpipe/Cmd; public fun getStdio ()Lspace/iseki/cmdpipe/Cmd$Stdio; public fun getStream ()Ljava/lang/Object; diff --git a/src/main/java/space/iseki/cmdpipe/Cmd.java b/src/main/java/space/iseki/cmdpipe/Cmd.java index c5d2443..3d83d80 100644 --- a/src/main/java/space/iseki/cmdpipe/Cmd.java +++ b/src/main/java/space/iseki/cmdpipe/Cmd.java @@ -169,6 +169,33 @@ interface Ctx { default @NotNull T getStream() { return stream(); } + + /** + * Get the command. + * + * @return the command + */ + default @NotNull Cmd component1() { + return cmd(); + } + + /** + * Get the standard IO stream. + * + * @return the standard IO stream + */ + default @NotNull Stdio component2() { + return stdio(); + } + + /** + * Get the stream. + * + * @return the stream + */ + default @NotNull T component3() { + return stream(); + } } @FunctionalInterface