Class ResultLog

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public class ResultLog
    extends java.lang.Object
    implements java.lang.Iterable<ResultLog.Entry>
    The log of a Result, allows for providing multiple lines of information which are aggregated as a single Result.
    • 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
        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
        entry - The entry to add
        the result log for chaining
      • iterator

        public java.util.Iterator<ResultLog.Entry> iterator()
        Return an Iterator on our entries
        Specified by:
        iterator in interface java.lang.Iterable<ResultLog.Entry>
        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.
        the aggregate status
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object