easytests.core.models.UserModel.map(UserEntity)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 10
rs 9.9
1
package easytests.core.models;
2
3
import easytests.core.entities.UserEntity;
4
import easytests.core.models.empty.ModelsListEmpty;
5
import java.util.List;
6
import lombok.*;
7
8
/**
9
 * @author malinink
10
 */
11
@Data
12
public class UserModel implements UserModelInterface {
13
    private Integer id;
14
15
    private String firstName;
16
17
    private String lastName;
18
19
    private String surname;
20
21
    private String email;
22
23
    private String password;
24
25
    private Boolean isAdmin;
26
27
    private Integer state;
28
29
    private List<SubjectModelInterface> subjects;
30
31
    public void map(UserEntity userEntity) {
32
        this.setId(userEntity.getId());
33
        this.setFirstName(userEntity.getFirstName());
34
        this.setLastName(userEntity.getLastName());
35
        this.setSurname(userEntity.getSurname());
36
        this.setEmail(userEntity.getEmail());
37
        this.setPassword(userEntity.getPassword());
38
        this.setIsAdmin(userEntity.getIsAdmin());
39
        this.setState(userEntity.getState());
40
        this.setSubjects(new ModelsListEmpty());
41
    }
42
}
43