Package org.apache.felix.hc.api
Class ResultLog
- java.lang.Object
-
- org.apache.felix.hc.api.ResultLog
-
- All Implemented Interfaces:
Iterable<ResultLog.Entry>
- Direct Known Subclasses:
FormattingResultLog
public class ResultLog extends Object implements Iterable<ResultLog.Entry>
The log of a Result, allows for providing multiple lines of information which are aggregated as a single Result.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResultLog.Entry
An entry in this log
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultLog
add(ResultLog.Entry entry)
Add an entry to this log.Result.Status
getAggregateStatus()
Return our aggregate status, i.e.Iterator<ResultLog.Entry>
iterator()
Return an Iterator on our entriesString
toString()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ResultLog
public ResultLog()
Build a log. Initial aggregate status is set to WARN, as an empty log is not considered ok. That's reset to OK before adding the first log entry, and then the status aggregation rules take over.
-
ResultLog
public ResultLog(ResultLog log)
Create a copy of the result log- Parameters:
log
- Clone constructor
-
-
Method Detail
-
add
public ResultLog add(ResultLog.Entry entry)
Add an entry to this log. The aggregate status of this is set to the highest of the current aggregate status and the new Entry's status- Parameters:
entry
- The entry to add- Returns:
- the result log for chaining
-
iterator
public Iterator<ResultLog.Entry> iterator()
Return an Iterator on our entries- Specified by:
iterator
in interfaceIterable<ResultLog.Entry>
- Returns:
- the iterator over all entries
-
getAggregateStatus
public Result.Status getAggregateStatus()
Return our aggregate status, i.e. the highest status of the entries added to this log. Starts at OK for an empty ResultLog, so cannot be lower than that.- Returns:
- the aggregate status
-
-