package org.sistema.springmvc.validation.models;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * Represents a user.
 * 
 * @author Eugenia Pérez Martínez
 *
 */
public class User {

	private int id;

	@Size(min = 4, max = 15, message = "Login must be between 4 and 15 characters long")
	@Pattern(regexp = "[A-Za-z0-9]+", message = "Must contain only chars and numbers")
	private String login;

	@Size(min = 6, max = 15, message = "Password must be between 6 and 15 characters long")
	private String password;

	@Size(max = 255, message = "Description must be less than 255 characters long")
	private String description;

	public User() {
	}

	public User(int id, String login, String description, String password) {
		this.id = id;
		this.login = login;
		this.description = description;
		this.password = password;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
