57 lines
1.1 KiB
Java
Raw Normal View History

2015-10-18 12:27:50 +05:30
package org.baeldung;
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-14 09:17:35 +05:30
@Size(min = 10, max = 200, message = "Number of characters should be in between 10 and 200 inclusive")
2015-10-02 11:47:36 +05:30
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;
}
}