Skip to content

Commit

Permalink
add optional on getRegulatedSide
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne LESOT <etienne.lesot@rte-france.com>
  • Loading branch information
EtienneLt committed Feb 26, 2024
1 parent e5fb533 commit 2f4e119
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.powsybl.iidm.network.TwoSides;

import java.util.Optional;

/**
* @author Yichen TANG <yichen.tang at rte-france.com>
*/
Expand Down Expand Up @@ -88,8 +90,8 @@ int getHighTapPosition() {
return targetV;
}

TwoSides getRegulatedSide() {
return regulatedSide;
Optional<TwoSides> getRegulatedSide() {
return Optional.of(regulatedSide);
}

double getV() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static DataframeMapper<List<TwtValidationData>> twtsValidationMapper() {
.ints("low_tap_position", TwtValidationData::getLowTapPosition)
.ints("high_tap_position", TwtValidationData::getHighTapPosition)
.doubles("target_v", TwtValidationData::getTargetV)
.strings("regulated_side", d -> d.getRegulatedSide().name())
.strings("regulated_side", d -> d.getRegulatedSide().map(Enum::name).orElse(""))
.doubles("v", TwtValidationData::getV)
.booleans("connected", TwtValidationData::isConnected)
.booleans("main_component", TwtValidationData::isMainComponent)
Expand Down

0 comments on commit 2f4e119

Please sign in to comment.