T
- the type of the Result
s that can be savedpublic interface ResultSaver<T extends Result>
Result
s to a file.
Specific implementations for different Result
types required.
Each implementation must register using ResultSaverLibrary.register(Class, ResultSaver)
to become available
in other classes.Modifier and Type | Method and Description |
---|---|
String[] |
getFileExtensions(T result)
Returns the file extensions (in descending preference) for storing the given
Result |
boolean |
isAtomic()
|
boolean |
writeOutput(T result,
File path)
Writes the output (i.e., the result contents) to the supplied file.
|
boolean |
writeOutput(T result,
StringBuffer buf)
Appends the output (i.e., the result contents) to the supplied
StringBuffer |
boolean isAtomic()
ResultSaver
is for storing atomic Result
s.String[] getFileExtensions(T result)
Result
result
- the resultboolean writeOutput(T result, File path)
result
- the resultpath
- the output fileboolean writeOutput(T result, StringBuffer buf)
StringBuffer
result
- the resultbuf
- the buffer