Conditions | 2 |
Total Lines | 27 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package com.osomapps.pt.goals; |
||
19 | List<GoalDTO> findAll() { |
||
20 | List<Goal> goals = goalRepository.findAll(); |
||
21 | return goals.stream() |
||
22 | .map( |
||
23 | goal -> |
||
24 | new GoalDTO() |
||
25 | .setId(goal.getId()) |
||
26 | .setTitle( |
||
27 | dictionaryService.getEnValue( |
||
28 | DictionaryName.goal_title, |
||
29 | goal.getDGoalTitle(), |
||
30 | null)) |
||
31 | .setTitle2( |
||
32 | dictionaryService.getEnValue( |
||
33 | DictionaryName.goal_title_2, |
||
34 | goal.getDGoalTitle2(), |
||
35 | null)) |
||
36 | .setType( |
||
37 | goal.getGoalType() == null |
||
38 | ? null |
||
39 | : goal.getGoalType().getName()) |
||
40 | .setParameters( |
||
41 | goal.getGoalParameters().stream() |
||
42 | .map(parameter -> parameter.getName()) |
||
43 | .collect(Collectors.toList()))) |
||
44 | .sorted((e1, e2) -> Long.compare(e1.getId(), e2.getId())) |
||
45 | .collect(Collectors.toList()); |
||
46 | } |
||
48 |