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.

Person.java 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. package com.vaadin.tests.data.bean;
  2. import java.math.BigDecimal;
  3. import java.time.LocalDate;
  4. public class Person {
  5. private String firstName;
  6. private String lastName;
  7. private String email;
  8. private int age;
  9. private Sex sex;
  10. private Address address;
  11. private boolean deceased;
  12. private LocalDate birthDate;
  13. private Integer salary; // null if unknown
  14. private Double salaryDouble; // null if unknown
  15. private BigDecimal rent;
  16. public Person() {
  17. }
  18. @Override
  19. public String toString() {
  20. return "Person [firstName=" + firstName + ", lastName=" + lastName
  21. + ", email=" + email + ", age=" + age + ", sex=" + sex
  22. + ", address=" + address + ", deceased=" + deceased
  23. + ", salary=" + salary + ", salaryDouble=" + salaryDouble
  24. + ", rent=" + rent + "]";
  25. }
  26. public Person(String firstName, String lastName, String email, int age,
  27. Sex sex, Address address) {
  28. super();
  29. this.firstName = firstName;
  30. this.lastName = lastName;
  31. this.email = email;
  32. this.age = age;
  33. this.sex = sex;
  34. this.address = address;
  35. }
  36. public String getFirstName() {
  37. return firstName;
  38. }
  39. public void setFirstName(String firstName) {
  40. this.firstName = firstName;
  41. }
  42. public String getLastName() {
  43. return lastName;
  44. }
  45. public void setLastName(String lastName) {
  46. this.lastName = lastName;
  47. }
  48. public int getAge() {
  49. return age;
  50. }
  51. public void setAge(int age) {
  52. this.age = age;
  53. }
  54. public Address getAddress() {
  55. return address;
  56. }
  57. public void setAddress(Address address) {
  58. this.address = address;
  59. }
  60. public Sex getSex() {
  61. return sex;
  62. }
  63. public void setSex(Sex sex) {
  64. this.sex = sex;
  65. }
  66. public String getEmail() {
  67. return email;
  68. }
  69. public void setEmail(String email) {
  70. this.email = email;
  71. }
  72. public boolean getDeceased() {
  73. return deceased;
  74. }
  75. public void setDeceased(boolean deceased) {
  76. this.deceased = deceased;
  77. }
  78. public Integer getSalary() {
  79. return salary;
  80. }
  81. public void setSalary(Integer salary) {
  82. this.salary = salary;
  83. }
  84. public BigDecimal getRent() {
  85. return rent;
  86. }
  87. public void setRent(BigDecimal rent) {
  88. this.rent = rent;
  89. }
  90. public Double getSalaryDouble() {
  91. return salaryDouble;
  92. }
  93. public void setSalaryDouble(Double salaryDouble) {
  94. this.salaryDouble = salaryDouble;
  95. }
  96. public LocalDate getBirthDate() {
  97. return birthDate;
  98. }
  99. public void setBirthDate(LocalDate birthDate) {
  100. this.birthDate = birthDate;
  101. }
  102. public static Person createTestPerson1() {
  103. return new Person("Foo", "Bar", "yeah@cool.com", 46, Sex.MALE,
  104. new Address("Street", 1123, "Turku", Country.FINLAND));
  105. }
  106. public static Person createTestPerson2() {
  107. return new Person("Maya", "Dinkelstein", "maya@foo.bar", 18, Sex.FEMALE,
  108. new Address("Red street", 12, "Amsterdam",
  109. Country.NETHERLANDS));
  110. }
  111. }