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