Class AbstractReport<T,R,P>

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

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

  • 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,R,P>
      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,R,P>
    • fullReportPath

      protected String fullReportPath()
      This default implementation uses Report.fullReportPath(String).
      Returns:
      a unique path for this report
    • loadAndCacheReport

      protected final T loadAndCacheReport() throws ReportException
      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: