public static interface ProcessHandle.Info
Optional<T>
allowing explicit tests
and actions if the value is available.Modifier and Type | Method | Description |
---|---|---|
java.util.Optional<String[]> |
arguments() |
Returns an array of Strings of the arguments of the process.
|
java.util.Optional<String> |
command() |
Returns the executable pathname of the process.
|
java.util.Optional<String> |
commandLine() |
Returns the command line of the process.
|
java.util.Optional<java.time.Instant> |
startInstant() |
Returns the start time of the process.
|
java.util.Optional<java.time.Duration> |
totalCpuDuration() |
Returns the total cputime accumulated of the process.
|
java.util.Optional<String> |
user() |
Return the user of the process.
|
java.util.Optional<String> command()
Optional<String>
of the executable pathname
of the processjava.util.Optional<String> commandLine()
If command()
and arguments()
return
non-empty optionals, this is simply a convenience method which concatenates
the values of the two functions separated by spaces. Otherwise it will return a
best-effort, platform dependent representation of the command line.
Optional<String>
of the command line
of the processjava.util.Optional<String[]> arguments()
Optional<String[]>
of the arguments of the processjava.util.Optional<java.time.Instant> startInstant()
Optional<Instant>
of the start time of the processjava.util.Optional<java.time.Duration> totalCpuDuration()
Optional<Duration>
for the accumulated total cputimejava.util.Optional<String> user()
Optional<String>
for the user of the process