T
- the message typepublic abstract class AbstractReporter<T extends Message> extends Object implements Reporter<T>
Constructor and Description |
---|
AbstractReporter(String taskName,
Class<T> messageType)
Create an empty report.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getFailSummary()
Get the default report summary if it was not successful.
|
Class<T> |
getMessageType()
Get the message type (for determining the message type at runtime).
|
Date |
getStartTime()
Get the start time of the report.
|
protected String |
getSuccessSummary()
Get the default report summary if it was successful.
|
String |
getSummary()
Get a short message stating a summary of the report
|
String |
getTaskName()
Get the name of the task the report relates to
|
Date |
getTimestamp()
Get the report time
|
boolean |
isSuccess()
States if the report represents a successful task
|
void |
setStartTime(Date starttime)
Set the start time of the report.
|
void |
setSuccess(boolean success)
Set if the task was successful.
|
void |
setSummary(String summary)
Set the summary message of the report.
|
void |
setTimestamp(Date timestamp)
Set the report time
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getErrors, getInfos, getWarnings
public AbstractReporter(String taskName, Class<T> messageType)
setSuccess(boolean)
nonetheless to update the
timestamp after the task has finished.taskName
- the name of the task the report is related tomessageType
- the message typepublic void setSummary(String summary)
setSummary
in interface Reporter<T extends Message>
summary
- the summary to set, if null
the report will
revert to the default summary.public String getTaskName()
Report
getTaskName
in interface Report<T extends Message>
Report.getTaskName()
public Class<T> getMessageType()
Report
getMessageType
in interface Report<T extends Message>
Report.getMessageType()
public String getSummary()
Report
getSummary
in interface Report<T extends Message>
Report.getSummary()
protected String getFailSummary()
protected String getSuccessSummary()
public Date getTimestamp()
Report
getTimestamp
in interface Report<T extends Message>
Report.getTimestamp()
public void setSuccess(boolean success)
Reporter
setSuccess
in interface Reporter<T extends Message>
success
- if the task was successfulReporter.setSuccess(boolean)
public boolean isSuccess()
Report
isSuccess
in interface Report<T extends Message>
Report.isSuccess()
public Date getStartTime()
Report
Report.getTimestamp()
can be seen as an end time and used
to compute a duration.getStartTime
in interface Report<T extends Message>
null
Report.getStartTime()
public void setTimestamp(Date timestamp)
Reporter
setTimestamp
in interface Reporter<T extends Message>
timestamp
- the timestampReporter.setTimestamp(java.util.Date)
public void setStartTime(Date starttime)
Reporter
Report.getTimestamp()
can be seen as an end time and used
to compute a duration.setStartTime
in interface Reporter<T extends Message>
starttime
- the starttimeReporter.setStartTime(java.util.Date)
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a