java.lang.Object
is.codion.common.db.report.AbstractReport<T,R,P>
- Type Parameters:
T
- the report typeR
- the report result typeP
- the report parameters type
- All Implemented Interfaces:
Report<T,
R, P>
A base class for wrapping reports, handles caching.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
The path of this report, relative to any defined #Report.REPORT_PATH
.Fields inherited from interface is.codion.common.db.report.Report
CACHE_REPORTS, REPORT_PATH
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractReport
(String reportPath, boolean cacheReport) Instantiates a new AbstractReport. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
cached()
final void
Clears the report cache, if caching is not enabled calling this method has no effectfinal boolean
protected String
This default implementation usesReport.fullReportPath(String)
.final int
hashCode()
protected final T
Returns the underlying report, either from the cache, if enabled or viaReport.load()
.final String
toString()
-
Field Details
-
reportPath
The path of this report, relative to any defined #Report.REPORT_PATH
.
-
-
Constructor Details
-
AbstractReport
Instantiates a new AbstractReport.- Parameters:
reportPath
- the report path, relative to the central report pathReport.REPORT_PATH
.cacheReport
- true if the report should be cached when loaded
-
-
Method Details
-
toString
-
equals
-
hashCode
public final int hashCode() -
cached
public final boolean 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 interfaceReport<T,
R, P>
-
fullReportPath
This default implementation usesReport.fullReportPath(String)
.- Returns:
- a unique path for this report
-
loadAndCacheReport
Returns the underlying report, either from the cache, if enabled or viaReport.load()
.- Returns:
- the report
- Throws:
ReportException
- in case of an exception- See Also:
-