Skip to content

Commit

Permalink
Merge branch 'main' into add_voltage_init_shunt_compensator_modificat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
FranckLecuyer authored Sep 11, 2023
2 parents 9c97261 + e6864c8 commit acb011f
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.gridsuite.modification.server.dto.SubstationCreationInfos;

import java.util.Map;
import java.util.Optional;

public class SubstationCreation extends AbstractModification {

Expand Down Expand Up @@ -47,12 +48,15 @@ public void apply(Network network, Reporter subReporter) {
.reportElementaryCreation(subReporter, modificationInfos.getSubstationCountry(), "Country");
}
// properties
modificationInfos.getProperties().forEach((key, value) -> subReporter.report(Report.builder()
.withKey("propertyAdded")
.withDefaultMessage(" Property ${name} added with value ${value}")
.withValue("name", key)
.withValue("value", value)
.withSeverity(TypedValue.INFO_SEVERITY)
.build()));
Optional.ofNullable(modificationInfos.getProperties())
.filter(propertie -> !properties.isEmpty())
.ifPresent(propertie -> properties.forEach((key, value) -> subReporter.report(Report.builder()
.withKey("propertyAdded")
.withDefaultMessage(" Property ${name} added with value ${value}")
.withValue("name", key)
.withValue("value", value)
.withSeverity(TypedValue.INFO_SEVERITY)
.build())));

}
}

0 comments on commit acb011f

Please sign in to comment.