Class Report


  • public final class Report
    extends Object
    Report is a log and issue container. Filled with information, details, minor or major issues, it is stored in an issue list and can be retrieved to present issues to end-users. Behavior is the same as a simple logging library.
    Author:
    Mathieu Bastian
    • Constructor Detail

      • Report

        public Report()
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • clean

        public void clean()
        Free resources.
      • close

        public void close()
        Closes writing.
      • log

        public void log​(String message)
        Log an information message in the report.
        Parameters:
        message - the message to write in the report
        Throws:
        NullPointerException - if message is null
      • append

        public void append​(Report report)
        Appends all entries in report to this report.
        Parameters:
        report - report to read entries from
      • logIssue

        public void logIssue​(Issue issue)
        Log an issue in the report.
        Parameters:
        issue - the issue to write in the report
        Throws:
        NullPointerException - if issue is null
      • getIssues

        public Iterator<Issue> getIssues​(int limit)
        Returns all issues written in the report.
        Parameters:
        limit - maximum number of issuers
        Returns:
        a collection of all issues written in the report
      • getText

        public String getText()
        Returns the report logs and issues, presented as basic multi-line text.
        Returns:
        a string of all messages and issues written in the report, one per line
      • getExceptionLevel

        public Issue.Level getExceptionLevel()
        Get the current exception level for the report. Default is Level.CRITICAL.
        Returns:
        the current exception level
      • setExceptionLevel

        public void setExceptionLevel​(Issue.Level exceptionLevel)
        Set the level of exception for the report. If a reported issue has his level greater or equal as exceptionLevel, an exception is thrown. Default is Level.CRITICAL
        Parameters:
        exceptionLevel - the exception level where exceptions are to be thrown