package com.spring.validate.bean;
import java.util.Date;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* <p>Project: spring_validate_annotation</p>
* <p>ClassName: User</p>
* <p>Description: </p>
* @author Aric
* @date 2015年12月29日 上午9:07:43
* @version 1.0
*/
public class User {
private long id;
@NotBlank(message="{valid.name}")
private String name;
@Length(min=4, max=20, message="{valid.password}")
private String password;
@NotBlank(message="{valid.required}")
@Email(message="{valid.email}")
private String email;
@NotNull(message="{valid.required}")
private boolean married;
@Min(value=18, message="{valid.ageMin}")
@Max(value=100, message="{valid.ageMax}")
private int age;
@NotNull(message="{valid.required}")
@Past(message="{valid.birthday}")
private Date birthday;
@Pattern(regexp="^[a-zA-Z]{2,}$", message="{valid.address}")
private String address;
@Size(min=1, message="{valid.likesMin}")
private String[] likes;
@com.spring.validate.validator.Tel(message="{valid.tel}", min=3)
private String tel;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public boolean isMarried() {
return married;
}
public void setMarried(boolean married) {
this.married = married;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String[] getLikes() {
return likes;
}
public void setLikes(String[] likes) {
this.likes = likes;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
}
Aric_Lv
- 粉丝: 0
- 资源: 17
最新资源
- 室内移动AGV服务咨询机器人proe全套技术资料100%好用.zip
- Windows 7错误代码为 0x00000124导致的蓝屏转储文件
- STM32+FreeRTOS 使用SystemView监控系统配套源码
- 三相并联型有源电力滤波器APF仿真(电压外环电流内环均为PI控制),id-iq谐波检测方法,SVPWM调制方法
- 收卷机自动换卷机(sw16可编辑+工程图)全套技术资料100%好用.zip
- Knife4j是一个集Swagger2 和 OpenAPI3为一体的增强解决方案
- 鸿蒙与原生WebH5的通信-DsBridge
- 鼎捷易飞新建账套方法步骤
- STM32+PAJ7620手势识别的智能家居控制系统识别系统程序设计
- 鼎捷易飞清楚账套内部交易数据的代码
- 实训报告-小型企业网络的搭建.docx
- 网络实践34344343443
- 基于java+springboot+mysql+微信小程序的医院核酸检测预约挂号系统 源码+数据库+论文(高分毕业设计).rar
- 基于java+ssm+mysql+微信小程序的新冠疫苗预约小程序 源码+数据库+论文(高分毕业设计).zip
- 基于Proteus的STM32 BLDC电机控制器设计与实现
- 基于java+ssm+mysql+微信小程序的新生自助报到系统 源码+数据库+论文(高分毕业设计).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈