public class FirstWorkingReporter extends java.lang.Object implements Reporter
Particular Reporter which allows to search in a list of potentially usable reporters for the first one available, and uses it.
This Reporter only searches in the reporters which are given to it while constructing it (it won’t parse the classpath or anything like this).
It also won’t try the reporters, but simply rely on their isAvailable() methods.
| Constructor and Description |
|---|
FirstWorkingReporter(Reporter... reporters)
Constructs a
FirstWorkingReporter with a list of potentially usable reporters |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAvailable()
Checks if a working reporter has been found or not.
|
void |
mismatch(java.nio.file.Path approved,
java.nio.file.Path received)
Reports a mismatch between the provided approved and received files using the first working reporter found.
|
public FirstWorkingReporter(Reporter... reporters)
Constructs a FirstWorkingReporter with a list of potentially usable reporters
Careful: the provided reporters will be parsed in the order you provided them! Be sure to order them in the order you actually want!
reporters - The reporters that could be usable, in which will search for the actual first availabepublic void mismatch(java.nio.file.Path approved,
java.nio.file.Path received)
Reports a mismatch between the provided approved and received files using the first working reporter found.
Since the FirstWorkingReporter is usualy used as a fallback reporter, in case no first working reporter can be found and a mismatch is raised, a log entry will be written in System.err.
public boolean isAvailable()
Checks if a working reporter has been found or not.
isAvailable in interface ReporterCopyright © 2018 Write Them First!. All rights reserved.