package karthik.restDTO; import org.hibernate.validator.constraints.Email; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; import java.util.List; public class UserDTO { @NotNull @Size(min = 1, max = 50) @Pattern(regexp = "^[A-Za-z0-9]*$") private String login; @NotNull @Size(min = 6, max = 100) private String password; @Size(max = 50) private String firstName; @Size(max = 50) private String lastName; @Email @Size(min=5, max = 100) private String email; @Size(min = 2, max = 5) private String langKey; private List<String> roles; public UserDTO() { } public UserDTO(String login, String password, String Name,List<String> roles) { this.login = login; this.password = password; this.firstName = firstName; this.lastName = lastName; this.email = email; this.langKey = langKey; this.roles = roles; } public String getPassword() { return password; } public String getLogin() { return login; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public String getEmail() { return email; } public String getLangKey() { return langKey; } public List<String> getRoles() { return roles; } @Override public String toString() { return "UserDTO{" + "login='" + login + '\'' + ", password='" + password + '\'' + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", langKey='" + langKey + '\'' + ", roles=" + roles + '}'; } }