Package dev.enola.common.exec
Record Class ProcessRequest
java.lang.Object
java.lang.Record
dev.enola.common.exec.ProcessRequest
- Record Components:
directory- the working directory for the processcommand- the command to executectx- theExecutionContextmergeErrIntoOut- whether to merge the error stream into the output stream
public record ProcessRequest(Path directory, ImmutableList<String> command, Supplier<ExecutionContext> ctx, boolean mergeErrIntoOut)
extends Record
ProcessRequest describes a request for the Operating System to run a program from an image in an
executable file.
This is not a Process, but what is needed to create one process (or several).
ProcessBuilder is similar to this. But that's tied to the JVM's builtin process
launcher - while this may use other means to execute the command. This intentionally has no
start() method, because it is passed to a ProcessLauncher to actually run it.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionProcessRequest(Path directory, ImmutableList<String> command, Supplier<ExecutionContext> ctx, boolean mergeErrIntoOut) Creates an instance of aProcessRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncommand()Returns the value of thecommandrecord component.ctx()Returns the value of thectxrecord component.Returns the value of thedirectoryrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of themergeErrIntoOutrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ProcessRequest
public ProcessRequest(Path directory, ImmutableList<String> command, Supplier<ExecutionContext> ctx, boolean mergeErrIntoOut) Creates an instance of aProcessRequestrecord class.- Parameters:
directory- the value for thedirectoryrecord componentcommand- the value for thecommandrecord componentctx- the value for thectxrecord componentmergeErrIntoOut- the value for themergeErrIntoOutrecord component
-
-
Method Details
-
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
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
directory
Returns the value of thedirectoryrecord component.- Returns:
- the value of the
directoryrecord component
-
command
Returns the value of thecommandrecord component.- Returns:
- the value of the
commandrecord component
-
ctx
Returns the value of thectxrecord component.- Returns:
- the value of the
ctxrecord component
-
mergeErrIntoOut
Returns the value of themergeErrIntoOutrecord component.- Returns:
- the value of the
mergeErrIntoOutrecord component
-