public class DevServerOutputTracker extends Object
Triggers an event whenever a success or failure pattern is found on a row.
Modifier and Type | Class and Description |
---|---|
static class |
DevServerOutputTracker.Result
Encapsulates the result of a find operation.
|
Constructor and Description |
---|
DevServerOutputTracker(InputStream inputStream,
Pattern success,
Pattern failure,
Consumer<DevServerOutputTracker.Result> onMatch)
Creates a new finder that scans for the given success and/or failure
pattern.
|
Modifier and Type | Method and Description |
---|---|
boolean |
awaitFirstMatch(int timeoutInSeconds)
Blocks until the first match is found and the callback has been run.
|
void |
find()
Runs the find operation.
|
public DevServerOutputTracker(InputStream inputStream, Pattern success, Pattern failure, Consumer<DevServerOutputTracker.Result> onMatch)
inputStream
- the stream to scansuccess
- the pattern indicating successfailure
- the pattern indicating failureonMatch
- callback triggered when either success or failure is foundpublic void find()
public boolean awaitFirstMatch(int timeoutInSeconds) throws InterruptedException
timeoutInSeconds
- the maximum number of seconds to waittrue
if a match was found, false
if a timeout
occurredInterruptedException
- if the finder thread is interruptedCopyright © 2024. All rights reserved.