/*******************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2013,2014 by Peter Pilgrim, Addiscombe, Surrey, XeNoNiQUe UK
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU GPL v3.0
* which accompanies this distribution, and is available at:
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Developers:
* Peter Pilgrim -- design, development and implementation
* -- Blog: http://www.xenonique.co.uk/blog/
* -- Twitter: @peter_pilgrim
*
* Contributors:
*
*******************************************************************************/
package je7hb.beanvalidation.essentials;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* The type Address
*
* @author Peter Pilgrim (peter)
*/
public class Address {
private String flatNo;
private String street1;
private String street2;
private String city;
private String postalCode;
private Country country;
@NotNull
@Size(max=50)
public String getStreet1() { return street1; }
@NotNull
@Size(max=50)
public String getStreet2() { return street2; }
@PostalCode(message="Postal code does not look right")
public String getPostalCode() { return postalCode; }
@NotNull @Valid
public Country getString() { return country; }
public void setFlatNo(String flatNo) {
this.flatNo = flatNo;
}
public void setStreet1(String street1) {
this.street1 = street1;
}
public void setStreet2(String street2) {
this.street2 = street2;
}
public void setCity(String city) {
this.city = city;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public void setCountry(Country country) {
this.country = country;
}
@Override
public String toString() {
return "Address{" +
"flatNo='" + flatNo + '\'' +
", street1='" + street1 + '\'' +
", street2='" + street2 + '\'' +
", city='" + city + '\'' +
", postalCode='" + postalCode + '\'' +
", country=" + country +
'}';
}
}