You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Address.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package com.vaadin.tests.data.bean;
  2. import java.io.Serializable;
  3. import javax.validation.constraints.Max;
  4. import javax.validation.constraints.Min;
  5. import javax.validation.constraints.NotNull;
  6. @SuppressWarnings("serial")
  7. public class Address implements Serializable {
  8. @NotNull
  9. private String streetAddress = "";
  10. @NotNull
  11. @Min(0)
  12. @Max(99999)
  13. private Integer postalCode = 0;
  14. @NotNull
  15. private String city = "";
  16. @NotNull
  17. private Country country = Country.FINLAND;
  18. public Address() {
  19. }
  20. public Address(String streetAddress, int postalCode, String city,
  21. Country country) {
  22. setStreetAddress(streetAddress);
  23. setPostalCode(postalCode);
  24. setCity(city);
  25. setCountry(country);
  26. }
  27. @Override
  28. public String toString() {
  29. return "Address [streetAddress=" + streetAddress + ", postalCode="
  30. + postalCode + ", city=" + city + ", country=" + country + "]";
  31. }
  32. public String getStreetAddress() {
  33. return streetAddress;
  34. }
  35. public void setStreetAddress(String streetAddress) {
  36. this.streetAddress = streetAddress;
  37. }
  38. public Integer getPostalCode() {
  39. return postalCode;
  40. }
  41. public void setPostalCode(Integer postalCode) {
  42. this.postalCode = postalCode;
  43. }
  44. public String getCity() {
  45. return city;
  46. }
  47. public void setCity(String city) {
  48. this.city = city;
  49. }
  50. public Country getCountry() {
  51. return country;
  52. }
  53. public void setCountry(Country country) {
  54. this.country = country;
  55. }
  56. }