View Javadoc
1   /*
2    * Copyright (c) 2015, Fraunhofer FOKUS
3    * All rights reserved.
4    * 
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions are met:
7    * 
8    * * Redistributions of source code must retain the above copyright notice, this
9    *   list of conditions and the following disclaimer.
10   * 
11   * * Redistributions in binary form must reproduce the above copyright notice,
12   *   this list of conditions and the following disclaimer in the documentation
13   *   and/or other materials provided with the distribution.
14   * 
15   * * Neither the name of particity nor the names of its
16   *   contributors may be used to endorse or promote products derived from
17   *   this software without specific prior written permission.
18   * 
19   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29   * 
30   * 
31   * 
32   * @author sma
33   */
34  package de.fraunhofer.fokus.oefit.adhoc.forms;
35  
36  import javax.validation.constraints.NotNull;
37  
38  import org.hibernate.validator.constraints.Email;
39  import org.hibernate.validator.constraints.NotBlank;
40  import org.hibernate.validator.constraints.NotEmpty;
41  
42  /**
43   * A form representing a user profile
44   */
45  public class ProfileForm {
46  
47  	private String	m_strForename;
48  	private String	m_strSurname;
49  	private String	m_strMail;
50  	private String	m_strPass1;
51  	private String	m_strPass2;
52  
53  	/**
54  	 * Instantiates a new profile form.
55  	 */
56  	public ProfileForm() {
57  		this.clear();
58  	}
59  
60  	/**
61  	 * Clear.
62  	 */
63  	public void clear() {
64  		this.m_strMail = "";
65  		this.m_strPass1 = "";
66  		this.m_strPass2 = "";
67  		this.m_strForename = "";
68  		this.m_strSurname = "";
69  	}
70  
71  	/**
72  	 * Gets the forename.
73  	 *
74  	 * @return the forename
75  	 */
76  	public String getForename() {
77  		return this.m_strForename;
78  	}
79  
80  	/**
81  	 * Gets the mail.
82  	 *
83  	 * @return the mail
84  	 */
85  	@NotEmpty(message = "common.form.profile.field.mail.empty")
86  	@NotNull(message = "common.form.profile.field.mail.empty")
87  	@NotBlank(message = "common.form.profile.field.mail.empty")
88  	@Email(message = "common.form.profile.field.mail.pattern")
89  	public String getMail() {
90  		return this.m_strMail;
91  	}
92  
93  	/**
94  	 * Gets the pass1.
95  	 *
96  	 * @return the pass1
97  	 */
98  	public String getPass1() {
99  		return this.m_strPass1;
100 	}
101 
102 	/**
103 	 * Gets the pass2.
104 	 *
105 	 * @return the pass2
106 	 */
107 	public String getPass2() {
108 		return this.m_strPass2;
109 	}
110 
111 	/**
112 	 * Gets the surname.
113 	 *
114 	 * @return the surname
115 	 */
116 	public String getSurname() {
117 		return this.m_strSurname;
118 	}
119 
120 	/**
121 	 * Sets the forename.
122 	 *
123 	 * @param val the new forename
124 	 */
125 	public void setForename(final String val) {
126 		this.m_strForename = val;
127 	}
128 
129 	/**
130 	 * Sets the mail.
131 	 *
132 	 * @param val the new mail
133 	 */
134 	public void setMail(final String val) {
135 		this.m_strMail = val;
136 	}
137 
138 	/**
139 	 * Sets the pass1.
140 	 *
141 	 * @param val the new pass1
142 	 */
143 	public void setPass1(final String val) {
144 		this.m_strPass1 = val;
145 	}
146 
147 	/**
148 	 * Sets the pass2.
149 	 *
150 	 * @param val the new pass2
151 	 */
152 	public void setPass2(final String val) {
153 		this.m_strPass2 = val;
154 	}
155 
156 	/**
157 	 * Sets the surname.
158 	 *
159 	 * @param val the new surname
160 	 */
161 	public void setSurname(final String val) {
162 		this.m_strSurname = val;
163 	}
164 
165 }