Package com.powsybl.commons.reporter
Class ReporterModel
java.lang.Object
com.powsybl.commons.reporter.AbstractReporter
com.powsybl.commons.reporter.ReporterModel
- All Implemented Interfaces:
Reporter
An in-memory implementation of
Reporter
.
Being an implementation of Reporter
, instances of ReporterModel
are not thread-safe.
A reporterModel is not meant to be shared with other threads nor to be saved as a class parameter, but should instead
be passed on in methods through their arguments. Respecting this ensures that
- sub-reporters always are in the same order
- reports always are in the same order
- Author:
- Florian Dupuy <florian.dupuy at rte-france.com>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.powsybl.commons.reporter.Reporter
Reporter.NoOpImpl
-
Field Summary
Fields inherited from class com.powsybl.commons.reporter.AbstractReporter
defaultName, taskKey, taskValues
-
Constructor Summary
ConstructorsConstructorDescriptionReporterModel
(String taskKey, String defaultName) ReporterModel constructor, with no associated values.ReporterModel
(String taskKey, String defaultName, Map<String, TypedValue> taskValues) ReporterModel constructor, with no associated values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubReporter
(ReporterModel reporterModel) Add a reporterModel to the sub-reporters of current reporterModel.createSubReporter
(String taskKey, String defaultName, Map<String, TypedValue> values) Create a sub-reporter for a specific task, to separate from current reports the reports from that task, with some associated values.void
void
static ReporterModel
parseJsonNode
(com.fasterxml.jackson.databind.JsonNode reportTree, Map<String, String> dictionary, com.fasterxml.jackson.core.ObjectCodec codec) void
Add a new reportMethods inherited from class com.powsybl.commons.reporter.AbstractReporter
createSubReporter, createSubReporter, createSubReporter, formatMessage, formatReportMessage, report, report, report, report
-
Constructor Details
-
ReporterModel
ReporterModel constructor, with no associated values.- Parameters:
taskKey
- the key identifying the corresponding taskdefaultName
- the name or message describing the corresponding task
-
ReporterModel
ReporterModel constructor, with no associated values.- Parameters:
taskKey
- the key identifying the corresponding taskdefaultName
- the name or message describing the corresponding task, which may contain references to the provided valuestaskValues
- a map ofTypedValue
indexed by their key, which may be referred to within the defaultName or within the reports message of created ReporterModel
-
-
Method Details
-
createSubReporter
public ReporterModel createSubReporter(String taskKey, String defaultName, Map<String, TypedValue> values) Description copied from interface:Reporter
Create a sub-reporter for a specific task, to separate from current reports the reports from that task, with some associated values.- Parameters:
taskKey
- the key identifying that taskdefaultName
- a name or message describing the corresponding task, which may contain references to the provided valuesvalues
- a map ofTypedValue
indexed by their key, which may be referred to within the defaultName or within the reports message of the created sub-reporter- Returns:
- the new sub-reporter
-
addSubReporter
Add a reporterModel to the sub-reporters of current reporterModel.- Parameters:
reporterModel
- the reporterModel to add
-
report
Description copied from interface:Reporter
Add a new report- Parameters:
report
- the report to add
-
getReports
-
getDefaultName
-
getTaskKey
-
getTaskValues
-
getSubReporters
-
export
-
export
-
parseJsonNode
public static ReporterModel parseJsonNode(com.fasterxml.jackson.databind.JsonNode reportTree, Map<String, String> dictionary, com.fasterxml.jackson.core.ObjectCodec codec) throws IOException- Throws:
IOException
-