-
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.
* Add copy to ReportNode API * Add unit test * Renaming copy -> addCopy * Add documentation * Improve coverage Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
- Loading branch information
Showing
10 changed files
with
248 additions
and
15 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
37 changes: 37 additions & 0 deletions
37
commons/src/main/java/com/powsybl/commons/report/TreeContextNoOp.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,37 @@ | ||
/** | ||
* Copyright (c) 2025, 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; | ||
|
||
/** | ||
* @author Florian Dupuy {@literal <florian.dupuy at rte-france.com>} | ||
*/ | ||
public class TreeContextNoOp implements TreeContext { | ||
|
||
@Override | ||
public Map<String, String> getDictionary() { | ||
return Map.of(); | ||
} | ||
|
||
@Override | ||
public DateTimeFormatter getTimestampFormatter() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isTimestampAdded() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void merge(TreeContext treeContext) { | ||
// no-op | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"version" : "2.1", | ||
"dictionaries" : { | ||
"default" : { | ||
"childNotCopied" : "Child message", | ||
"childToCopy" : "Child message with inherited value ${value}", | ||
"existingChild" : "Child message", | ||
"grandChild" : "Grandchild message", | ||
"otherRoot" : "Root message containing node to copy", | ||
"root" : "Root message with value ${value}" | ||
} | ||
}, | ||
"reportRoot" : { | ||
"messageKey" : "root", | ||
"values" : { | ||
"value" : { | ||
"value" : 2.3203, | ||
"type" : "ROOT_VALUE" | ||
} | ||
}, | ||
"children" : [ { | ||
"messageKey" : "existingChild" | ||
}, { | ||
"messageKey" : "childToCopy", | ||
"children" : [ { | ||
"messageKey" : "grandChild" | ||
} ] | ||
} ] | ||
} | ||
} |
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,7 @@ | ||
{ | ||
"version" : "2.1", | ||
"dictionaries" : { | ||
"default" : { } | ||
}, | ||
"reportRoot" : { } | ||
} |
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