easytests.core.models.QuestionModel   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
c 1
b 0
f 0
loc 19
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A map(QuestionEntity) 0 6 1
1
package easytests.core.models;
2
3
import easytests.core.entities.QuestionEntity;
4
import easytests.core.models.empty.ModelsListEmpty;
5
import easytests.core.models.empty.QuestionTypeModelEmpty;
6
import easytests.core.models.empty.TopicModelEmpty;
7
import java.util.List;
8
import lombok.*;
9
10
/**
11
 * @author firkhraag
12
 */
13
@Data
14
public class QuestionModel implements QuestionModelInterface {
15
16
    private Integer id;
17
18
    private String text;
19
20
    private QuestionTypeModelInterface questionType;
21
22
    private TopicModelInterface topic;
23
24
    private List<AnswerModelInterface> answers;
25
26
    public void map(QuestionEntity questionEntity) {
27
        this.setId(questionEntity.getId());
28
        this.setText(questionEntity.getText());
29
        this.setQuestionType(new QuestionTypeModelEmpty(questionEntity.getQuestionTypeId()));
30
        this.setTopic(new TopicModelEmpty(questionEntity.getTopicId()));
31
        this.setAnswers(new ModelsListEmpty());
32
    }
33
}
34