-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ReportNode deserialization by enriching ReportNode API with TreeC…
…ontext (#3155) * Enriching the ReportNode API to have a generic deserializer * Add merge and javadoc to interface * Rename RootContext into TreeContext Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
- Loading branch information
Showing
11 changed files
with
131 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
commons/src/main/java/com/powsybl/commons/report/TreeContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2024, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.commons.report; | ||
|
||
import java.time.format.DateTimeFormatter; | ||
import java.util.Map; | ||
|
||
/** | ||
* Context attached to a {@link ReportNode} tree. | ||
* It contains parameters intended to be used by all the {@link ReportNode} sharing the same tree. | ||
* Hence, all the nodes of a tree should point to the same {@link TreeContext} through {@link ReportNode#getTreeContext()}. | ||
* | ||
* @author Florian Dupuy {@literal <florian.dupuy at rte-france.com>} | ||
*/ | ||
public interface TreeContext { | ||
|
||
/** | ||
* Get the dictionary of message templates indexed by their key. | ||
*/ | ||
Map<String, String> getDictionary(); | ||
|
||
/** | ||
* Get the {@link DateTimeFormatter} to use for timestamps, if enabled. | ||
*/ | ||
DateTimeFormatter getTimestampFormatter(); | ||
|
||
/** | ||
* Return whether a timestamp is added at each {@link ReportNode} creation. | ||
*/ | ||
boolean isTimestampAdded(); | ||
|
||
/** | ||
* Merge given {@link TreeContext} with current one. | ||
*/ | ||
void merge(TreeContext treeContext); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.