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
FieldsModifier and TypeFieldDescriptionprotected final StringThe 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
ConstructorsModifierConstructorDescriptionprotectedAbstractReport(String reportPath, boolean cacheReport) Instantiates a new AbstractReport. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleancached()final voidClears the report cache, if caching is not enabled calling this method has no effectfinal booleanprotected StringThis default implementation usesReport.fullReportPath(String).final inthashCode()protected final TReturns the underlying report, either from the cache, if enabled or viaReport.load().final StringtoString()
-
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:ReportClears the report cache, if caching is not enabled calling this method has no effect- Specified by:
clearCachein 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:
-