View Javadoc
1   /*
2    * The coLAB project
3    * Copyright (C) 2021-2023 AlbaSim, MEI, HEIG-VD, HES-SO
4    *
5    * Licensed under the MIT License
6    */
7   package ch.colabproject.colab.api.model.user;
8   
9   import javax.validation.constraints.NotNull;
10  
11  import ch.colabproject.colab.generator.model.annotations.ExtractJavaDoc;
12  import ch.colabproject.colab.generator.model.interfaces.WithJsonDiscriminator;
13  
14  /**
15   * Contains information sent by a user to create a new local account
16   *
17   * @author maxence
18   */
19  @ExtractJavaDoc
20  public class SignUpInfo implements WithJsonDiscriminator {
21  
22      private static final long serialVersionUID = 1L;
23  
24      /**
25       * user email
26       */
27      @NotNull
28      private String email;
29  
30      /**
31       * username
32       */
33      @NotNull
34      private String username;
35  
36      /**
37       * firstname
38       */
39      // @NotNull // not yet possible as there is old data without lastname
40      private String firstname;
41  
42      /**
43       * lastname
44       */
45      // @NotNull // not yet possible as there is old data without lastname
46      private String lastname;
47  
48      /**
49       * affiliation
50       */
51      private String affiliation;
52  
53      /**
54       * Hash method used to generate hash
55       */
56      @NotNull
57      private HashMethod hashMethod;
58  
59      /**
60       * salt used to prefix plain password
61       */
62      @NotNull
63      private String salt;
64  
65      /**
66       * hashMethod(salt+password) result
67       */
68      @NotNull
69      private String hash;
70  
71      /**
72       * @return the email
73       */
74      public String getEmail() {
75          return email;
76      }
77  
78      /**
79       * email
80       *
81       * @param email email
82       */
83      public void setEmail(String email) {
84          this.email = email;
85      }
86  
87      /**
88       * @return username
89       */
90      public String getUsername() {
91          return username;
92      }
93  
94      /**
95       * username
96       *
97       * @param username username
98       */
99      public void setUsername(String username) {
100         this.username = username;
101     }
102 
103     /**
104      * @return firstname
105      */
106     public String getFirstname() {
107         return firstname;
108     }
109 
110     /**
111      * firstname
112      *
113      * @param firstname firstname
114      */
115     public void setFirstname(String firstname) {
116         this.firstname = firstname;
117     }
118 
119     /**
120      * @return lastname
121      */
122     public String getLastname() {
123         return lastname;
124     }
125 
126     /**
127      * lastname
128      *
129      * @param lastname lastname
130      */
131     public void setLastname(String lastname) {
132         this.lastname = lastname;
133     }
134 
135     /**
136      * @return affiliation
137      */
138     public String getAffiliation() {
139         return affiliation;
140     }
141 
142     /**
143      * affiliation
144      *
145      * @param affiliation affiliation
146      */
147     public void setAffiliation(String affiliation) {
148         this.affiliation = affiliation;
149     }
150 
151     /**
152      * @return hash method
153      */
154     public HashMethod getHashMethod() {
155         return hashMethod;
156     }
157 
158     /**
159      * set hash method
160      *
161      * @param hashMethod hashMethod
162      */
163     public void setHashMethod(HashMethod hashMethod) {
164         this.hashMethod = hashMethod;
165     }
166 
167     /**
168      * @return the salt the user use to salt its plain password
169      */
170     public String getSalt() {
171         return salt;
172     }
173 
174     /**
175      * set the salt
176      *
177      * @param salt the salt
178      */
179     public void setSalt(String salt) {
180         this.salt = salt;
181     }
182 
183     /**
184      * @return the hash
185      */
186     public String getHash() {
187         return hash;
188     }
189 
190     /**
191      * @param hash the hash
192      */
193     public void setHash(String hash) {
194         this.hash = hash;
195     }
196 }