1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.yaml.snakeyaml.issues.issue8;
17
18 import java.io.Serializable;
19
20
21
22
23 public class Person implements Serializable {
24 private static final long serialVersionUID = 1L;
25 private String firstName;
26 private String lastName;
27 private int hatSize;
28
29 public Person() {
30 }
31
32 public Person(String firstName, String lastName, int hatSize) {
33 this.firstName = firstName;
34 this.lastName = lastName;
35 this.hatSize = hatSize;
36 }
37
38 public String getFirstName() {
39 return firstName;
40 }
41
42 public void setFirstName(String firstName) {
43 this.firstName = firstName;
44 }
45
46 public String getLastName() {
47 return lastName;
48 }
49
50 public void setLastName(String lastName) {
51 this.lastName = lastName;
52 }
53
54 public int getHatSize() {
55 return hatSize;
56 }
57
58 public void setHatSize(int hatSize) {
59 this.hatSize = hatSize;
60 }
61
62 @Override
63 public boolean equals(Object object) {
64 if (object instanceof Person) {
65 Person person = (Person) object;
66 return firstName.equals(person.firstName) && lastName.equals(person.lastName)
67 && hatSize == person.hatSize;
68 }
69 return false;
70 }
71
72 @Override
73 public int hashCode() {
74 return 1;
75 }
76 }