Record Class CommandOutputControl.Result
java.lang.Object
java.lang.Record
jdk.jpackage.internal.util.CommandOutputControl.Result
- Enclosing class:
CommandOutputControl
public static record CommandOutputControl.Result(Optional<Integer> exitCode, Optional<jdk.jpackage.internal.util.CommandOutputControl.CommandOutput<List<String>>> output, Optional<jdk.jpackage.internal.util.CommandOutputControl.CommandOutput<byte[]>> byteOutput, CommandOutputControl.ExecutableSpec execSpec)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionResult(int exitCode) Result(Optional<Integer> exitCode, Optional<jdk.jpackage.internal.util.CommandOutputControl.CommandOutput<List<String>>> output, Optional<jdk.jpackage.internal.util.CommandOutputControl.CommandOutput<byte[]>> byteOutput, CommandOutputControl.ExecutableSpec execSpec) Creates an instance of aResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Optional<jdk.jpackage.internal.util.CommandOutputControl.CommandOutput<byte[]>> Returns the value of thebyteOutputrecord component.byte[]byte[]content()final booleanIndicates whether some other object is "equal to" this one.execSpec()Returns the value of theexecSpecrecord component.exitCode()Returns the value of theexitCoderecord component.expectExitCode(int main, int... other) expectExitCode(Collection<Integer> expected) expectExitCode(IntPredicate expected) Optional<byte[]> Optional<byte[]> Optional<byte[]> intfinal inthashCode()Returns a hash code value for this object.output()Returns the value of theoutputrecord component.stderr()stdout()toCharacterResult(Charset charset, boolean keepByteContent) final StringtoString()Returns a string representation of this record class.unexpected(String message)
-
Constructor Details
-
Result
public Result(Optional<Integer> exitCode, Optional<jdk.jpackage.internal.util.CommandOutputControl.CommandOutput<List<String>>> output, Optional<jdk.jpackage.internal.util.CommandOutputControl.CommandOutput<byte[]>> byteOutput, CommandOutputControl.ExecutableSpec execSpec) Creates an instance of aResultrecord class.- Parameters:
exitCode- the value for theexitCoderecord componentoutput- the value for theoutputrecord componentbyteOutput- the value for thebyteOutputrecord componentexecSpec- the value for theexecSpecrecord component
-
Result
public Result(int exitCode)
-
-
Method Details
-
getExitCode
public int getExitCode() -
expectExitCode
public CommandOutputControl.Result expectExitCode(int main, int... other) throws CommandOutputControl.UnexpectedExitCodeException -
expectExitCode
public CommandOutputControl.Result expectExitCode(Collection<Integer> expected) throws CommandOutputControl.UnexpectedExitCodeException -
expectExitCode
public CommandOutputControl.Result expectExitCode(IntPredicate expected) throws CommandOutputControl.UnexpectedExitCodeException -
unexpected
-
unexpected
-
findContent
-
findStdout
-
findStderr
-
getOutput
-
content
-
stdout
-
stderr
-
findByteContent
-
findByteStdout
-
findByteStderr
-
byteContent
public byte[] byteContent() -
byteStdout
public byte[] byteStdout() -
byteStderr
public byte[] byteStderr() -
toCharacterResult
public CommandOutputControl.Result toCharacterResult(Charset charset, boolean keepByteContent) throws IOException - Throws:
IOException
-
copyWithExecutableSpec
public CommandOutputControl.Result copyWithExecutableSpec(CommandOutputControl.ExecutableSpec execSpec) -
toString
-
hashCode
-
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). -
exitCode
-
output
-
byteOutput
Returns the value of thebyteOutputrecord component.- Returns:
- the value of the
byteOutputrecord component
-
execSpec
Returns the value of theexecSpecrecord component.- Returns:
- the value of the
execSpecrecord component
-