Class AbstractReport<T, P extends @Nullable Object, R>

java.lang.Object
is.codion.framework.domain.report.AbstractReport<T,P,R>
Type Parameters:
T - the report type
P - the report parameters type
R - the report result type
All Implemented Interfaces:
Report<T,P,R>

public abstract class AbstractReport<T, P extends @Nullable Object, R> extends Object implements Report<T,P,R>
A base class for wrapping reports, handles caching.
  • Constructor Details

    • AbstractReport

      protected AbstractReport(String reportPath, boolean cacheReport)
      Instantiates a new AbstractReport.
      Parameters:
      reportPath - the report path, relative to the central report path Report.REPORT_PATH.
      cacheReport - true if the report should be cached when loaded
  • Method Details

    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • cached

      public final boolean cached()
      Specified by:
      cached in interface Report<T, P extends @Nullable Object, R>
      Returns:
      true if this report has been cached
    • clearCache

      public final void clearCache()
      Description copied from interface: Report
      Clears the report cache, if caching is not enabled calling this method has no effect
      Specified by:
      clearCache in interface Report<T, P extends @Nullable Object, R>
    • fullReportPath

      protected String fullReportPath()
      This default implementation combines the report location specified by Report.REPORT_PATH and the path of this report.
      Returns:
      a unique path for this report
      Throws:
      NoSuchElementException - in case Report.REPORT_PATH is not specified
    • reportPath

      protected final String reportPath()
      Returns:
      the report path
    • report

      protected final T report()
      Returns the underlying report, either from the cache, if enabled or via Report.load().
      Returns:
      the report
      Throws:
      ReportException - in case of an exception
      See Also: