| 1 | package com.amigoscode.beans; |
| 2 | |
| 3 | public class PersonDTO { |
| 4 | |
| 5 | private final Integer id; |
| 6 | private final String name; |
| 7 | private final Integer age; |
| 8 | |
| 9 | public PersonDTO(Integer id, String name, Integer age) { |
| 10 | this.id = id; |
| 11 | this.name = name; |
| 12 | this.age = age; |
| 13 | } |
| 14 | |
| 15 | public Integer getId() { |
| 16 | return id; |
| 17 | } |
| 18 | |
| 19 | public String getName() { |
| 20 | return name; |
| 21 | } |
| 22 | |
| 23 | public Integer getAge() { |
| 24 | return age; |
| 25 | } |
| 26 | |
| 27 | |
| 28 | @Override |
| 29 | public String toString() { |
| 30 | return "PeopleDTO{" + |
| 31 | "id=" + id + |
| 32 | ", name='" + name + '\'' + |
| 33 | ", age=" + age + |
| 34 | '}'; |
| 35 | } |
| 36 | |
| 37 | public static PersonDTO map(Person person) { |
| 38 | return new PersonDTO( |
| 39 | person.getId(), |
| 40 | person.getFirstName(), |
| 41 | person.getAge()); |
| 42 | } |
| 43 | } |
nothing calls this directly
no outgoing calls
no test coverage detected