View Javadoc
1   /*
2    * Copyright 2018-2022 Medical Information Systems Research Group (https://medical.zcu.cz),
3    * Department of Computer Science and Engineering, University of West Bohemia.
4    * Address: Univerzitni 8, 306 14 Plzen, Czech Republic.
5    *
6    * Author Petr Vcelak (vcelak@kiv.zcu.cz).
7    *
8    * This file is part of MRECore project.
9    *
10   * MRECore is free software: you can redistribute it and/or modify
11   * it under the terms of the GNU General Public License as published by
12   * the Free Software Foundation, either version 3 of the License.
13   *
14   * MRECore is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17   * GNU General Public License for more details.
18   *
19   * You should have received a copy of the GNU General Public License
20   * along with MRECore. If not, see <http://www.gnu.org/licenses/>.
21   */
22  package cz.zcu.mre.data.account;
23  
24  /**
25   * @author Petr Vcelak (vcelak@kiv.zcu.cz)
26   */
27  public class RegistrationForm {
28  
29      private static final String NOT_BLANK_MESSAGE = "{notBlank.message}";
30      private static final String EMAIL_MESSAGE = "{email.message}";
31  
32      //@NotBlank(message = RegistrationForm.NOT_BLANK_MESSAGE)
33      //@Email(message = RegistrationForm.EMAIL_MESSAGE)
34      private String email;
35  
36      //@NotBlank(message = RegistrationForm.NOT_BLANK_MESSAGE)
37      private String password;
38  
39      private String titleBefore, titleAfter;
40  
41      //@NotBlank(message = RegistrationForm.NOT_BLANK_MESSAGE)
42      private String firstName;
43      //@NotBlank(message = RegistrationForm.NOT_BLANK_MESSAGE)
44      private String lastName;
45      //@NotBlank(message = RegistrationForm.NOT_BLANK_MESSAGE)
46      private String organisation;
47      //@NotBlank(message = RegistrationForm.NOT_BLANK_MESSAGE)
48      private String position;
49      //@NotBlank(message = RegistrationForm.NOT_BLANK_MESSAGE)
50      private String address;
51  
52      //@NotBlank(message = RegistrationForm.NOT_BLANK_MESSAGE)
53      private String city, zip, country;
54  
55      public String getEmail() {
56          return email;
57      }
58  
59      public void setEmail(String email) {
60          this.email = email;
61      }
62  
63      public String getPassword() {
64          return password;
65      }
66  
67      public void setPassword(String password) {
68          this.password = password;
69      }
70  
71      public String getTitleBefore() {
72          return titleBefore;
73      }
74  
75      public void setTitleBefore(String titleBefore) {
76          this.titleBefore = titleBefore;
77      }
78  
79      public String getTitleAfter() {
80          return titleAfter;
81      }
82  
83      public void setTitleAfter(String titleAfter) {
84          this.titleAfter = titleAfter;
85      }
86  
87      public String getFirstName() {
88          return firstName;
89      }
90  
91      public void setFirstName(String firstName) {
92          this.firstName = firstName;
93      }
94  
95      public String getLastName() {
96          return lastName;
97      }
98  
99      public void setLastName(String lastName) {
100         this.lastName = lastName;
101     }
102 
103     public String getOrganisation() {
104         return organisation;
105     }
106 
107     public void setOrganisation(String organisation) {
108         this.organisation = organisation;
109     }
110 
111     public String getPosition() {
112         return position;
113     }
114 
115     public void setPosition(String position) {
116         this.position = position;
117     }
118 
119     public String getAddress() {
120         return address;
121     }
122 
123     public void setAddress(String address) {
124         this.address = address;
125     }
126 
127     public String getCity() {
128         return city;
129     }
130 
131     public void setCity(String city) {
132         this.city = city;
133     }
134 
135     public String getZip() {
136         return zip;
137     }
138 
139     public void setZip(String zip) {
140         this.zip = zip;
141     }
142 
143     public String getCountry() {
144         return country;
145     }
146 
147     public void setCountry(String country) {
148         this.country = country;
149     }
150 
151     public Account createAccount() {
152         return new Account(getEmail(), getPassword(), "ROLE_USER");
153     }
154 }