public class PredicateLogConsumer extends LogConsumer
LogConsumer that tests a predicate in the output and sets a flag if it
matched at least once.error, meter| Constructor and Description |
|---|
PredicateLogConsumer(ProgressMeter meter,
boolean error,
Predicate<String> predicate)
Creates a new
PredicateLogConsumer. |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(String line) |
boolean |
hasMatched()
Returns
true if the predicate matched at least once in the stream. |
public PredicateLogConsumer(ProgressMeter meter, boolean error, Predicate<String> predicate)
PredicateLogConsumer.meter - ProgressMeter to log intoerror - true: this LogConsumer logs errors, false:
information and warningspredicate - Predicate to check. The predicate is only tested until it returns
true for the first time.public void accept(String line)
accept in interface Consumer<String>accept in class LogConsumerpublic boolean hasMatched()
true if the predicate matched at least once in the stream.Copyright © 2016. All rights reserved.