57 lines
1.1 KiB
Java
Raw Normal View History

package sample.model;
2015-10-02 11:47:36 +05:30
import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
2015-10-02 11:47:36 +05:30
import javax.validation.constraints.Size;
public class User {
2015-10-02 11:47:36 +05:30
@NotNull(message = "Name cannot be null")
private String name;
2015-10-02 11:47:36 +05:30
@AssertTrue
private boolean working;
2015-10-02 11:47:36 +05:30
@Size(min = 10, max = 200, message = "About me should not exceed more than 10 characters")
private String aboutMe;
2015-10-02 11:47:36 +05:30
@Min(value = 18, message = "Age should not be less than 18")
@Max(value = 150, message = "Age should not be more than 150")
private int age;
2015-10-02 11:47:36 +05:30
public int getAge() {
return age;
}
2015-10-02 11:47:36 +05:30
public void setAge(int age) {
this.age = age;
}
2015-10-02 11:47:36 +05:30
public boolean isWorking() {
return working;
}
2015-10-02 11:47:36 +05:30
public void setWorking(boolean working) {
this.working = working;
}
2015-10-02 11:47:36 +05:30
public String getAboutMe() {
return aboutMe;
}
2015-10-02 11:47:36 +05:30
public void setAboutMe(String aboutMe) {
this.aboutMe = aboutMe;
}
2015-10-02 11:47:36 +05:30
public String getName() {
return name;
}
2015-10-02 11:47:36 +05:30
public void setName(String name) {
this.name = name;
}
}