Created
February 9, 2022 23:40
-
-
Save httpmurilo/3e8ccddff78e2e0694d4152d743fd649 to your computer and use it in GitHub Desktop.
Default DTO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.httpmurilo.sales.dto; | |
import io.httpmurilo.sales.entity.User; | |
public class UserDTO { | |
public UserDTO convertToUser(User user) { | |
UserDTO dto = new UserDTO(); | |
dto.setName(user.getName()); | |
dto.setAge(user.getAge()); | |
dto.setEmail(user.getName()); | |
return dto; | |
} | |
private String name; | |
private Integer age; | |
private String email; | |
//getters and setters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment