Package com.tnsai.quality.sandbox
Record Class Command
java.lang.Object
java.lang.Record
com.tnsai.quality.sandbox.Command
- Record Components:
argv- argument vector. Index 0 is the program; positional arguments follow. Empty argv is rejected.stdin- optional bytes piped to the process's stdin
One executable step inside a
Sandbox (TNS-296). Wraps the
argv plus optional stdin so callers can run multiple commands in
the same sandbox lifetime without recreating it.- Since:
- 0.10.0 (TNS-296)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionargv()Returns the value of theargvrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static CommandConvenience forargv-only commands.static CommandRun a shell pipeline.Optional<byte[]> stdin()Returns the value of thestdinrecord component.final StringtoString()Returns a string representation of this record class.static CommandConvenience for argv + stdin.
-
Constructor Details
-
Method Details
-
of
Convenience forargv-only commands. -
shell
Run a shell pipeline. The caller is responsible for shell-escaping; the framework does not parsescript. Defaults to/bin/sh -c <script>on POSIX backends; the Windows backend translates this tocmd /c <script>. -
withStdin
Convenience for argv + stdin. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
argv
Returns the value of theargvrecord component.- Returns:
- the value of the
argvrecord component
-
stdin
Returns the value of thestdinrecord component.- Returns:
- the value of the
stdinrecord component
-