@@ -231,17 +231,17 @@ private static SubjectLimitViolationDTO toSubjectLimitViolationDTO(LimitViolatio
231231
232232 return new SubjectLimitViolationDTO (
233233 limitViolation .getSubjectId (),
234- new LimitViolationDTO (
235- limitViolation .getLimitType (),
236- limitViolation .getLimitName (),
237- limitViolation .getSide (),
238- limitViolation .getAcceptableDuration (),
239- limitViolation .getLimit (),
240- limitViolation .getLimitReduction (),
241- limitViolation .getValue (),
242- computedLoading ,
243- ComputationResultUtils .getViolationLocationId (limitViolation , getNetwork ())
244- )
234+ LimitViolationDTO . builder ()
235+ . limitType ( limitViolation .getLimitType ())
236+ . limitName ( limitViolation .getLimitName ())
237+ . side ( limitViolation .getSide ())
238+ . acceptableDuration ( limitViolation .getAcceptableDuration ())
239+ . limit ( limitViolation .getLimit ())
240+ . limitReduction ( limitViolation .getLimitReduction ())
241+ . value ( limitViolation .getValue ())
242+ . loading ( computedLoading )
243+ . locationId ( ComputationResultUtils .getViolationLocationId (limitViolation , getNetwork () ))
244+ . build ( )
245245 );
246246 }
247247
@@ -258,17 +258,17 @@ private static PreContingencyLimitViolationResultDTO toPreContingencyResultDTO(L
258258 return new PreContingencyLimitViolationResultDTO (
259259 limitViolation .getSubjectId (),
260260 status .name (),
261- new LimitViolationDTO (
262- limitViolation .getLimitType (),
263- limitViolation .getLimitName (),
264- limitViolation .getSide (),
265- limitViolation .getAcceptableDuration (),
266- limitViolation .getLimit (),
267- limitViolation .getLimitReduction (),
268- limitViolation .getValue (),
269- computedLoading ,
270- ComputationResultUtils .getViolationLocationId (limitViolation , getNetwork ())
271- ));
261+ LimitViolationDTO . builder ()
262+ . limitType ( limitViolation .getLimitType ())
263+ . limitName ( limitViolation .getLimitName ())
264+ . side ( limitViolation .getSide ())
265+ . acceptableDuration ( limitViolation .getAcceptableDuration ())
266+ . limit ( limitViolation .getLimit ())
267+ . limitReduction ( limitViolation .getLimitReduction ())
268+ . value ( limitViolation .getValue ())
269+ . loading ( computedLoading )
270+ . locationId ( ComputationResultUtils .getViolationLocationId (limitViolation , getNetwork () ))
271+ . build ( ));
272272 }
273273
274274 private static ContingencyResultDTO toContingencyResultDTO (Contingency contingency , String status , List <LimitViolation > limitViolations ) {
@@ -295,17 +295,17 @@ private static ContingencyLimitViolationDTO toContingencyLimitViolationDTO(Conti
295295 status ,
296296 contingency .getElements ().stream ().map (e -> new ContingencyElementDTO (e .getId (), e .getType ())).toList ()
297297 ),
298- new LimitViolationDTO (
299- limitViolation .getLimitType (),
300- limitViolation .getLimitName (),
301- limitViolation .getSide (),
302- limitViolation .getAcceptableDuration (),
303- limitViolation .getLimit (),
304- limitViolation .getLimitReduction (),
305- limitViolation .getValue (),
306- computedLoading ,
307- ComputationResultUtils .getViolationLocationId (limitViolation , getNetwork ())
308- )
298+ LimitViolationDTO . builder ()
299+ . limitType ( limitViolation .getLimitType ())
300+ . limitName ( limitViolation .getLimitName ())
301+ . side ( limitViolation .getSide ())
302+ . acceptableDuration ( limitViolation .getAcceptableDuration ())
303+ . limit ( limitViolation .getLimit ())
304+ . limitReduction ( limitViolation .getLimitReduction ())
305+ . value ( limitViolation .getValue ())
306+ . loading ( computedLoading )
307+ . locationId ( ComputationResultUtils .getViolationLocationId (limitViolation , getNetwork () ))
308+ . build ( )
309309 );
310310 }
311311
0 commit comments