com.osomapps.pt.admin.user.AdminUserLevelService   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
dl 0
loc 11
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A findAll() 0 8 1
1
package com.osomapps.pt.admin.user;
2
3
import com.osomapps.pt.user.UserLevel;
4
import java.util.List;
5
import java.util.stream.Collectors;
6
import java.util.stream.Stream;
7
import org.springframework.stereotype.Service;
8
9
@Service
10
class AdminUserLevelService {
11
12
    List<UserLevelResponseDTO> findAll() {
13
        return Stream.of(UserLevel.values())
14
                .map(
15
                        level ->
16
                                new UserLevelResponseDTO()
17
                                        .setId(level.getLevel())
18
                                        .setName(level.name()))
19
                .collect(Collectors.toList());
20
    }
21
}
22