/
Person.java
109 lines (88 loc) · 2.42 KB
/
Person.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* Copyright (c) 2017 Otávio Santana and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
*
* You may elect to redistribute this code under either of these licenses.
*
* Contributors:
*
* Otavio Santana
*/
package jakarta.nosql.tck.entities;
import jakarta.nosql.mapping.Column;
import jakarta.nosql.mapping.Entity;
import jakarta.nosql.mapping.Id;
import jakarta.nosql.mapping.MappedSuperclass;
import java.util.List;
import java.util.Objects;
@Entity
@MappedSuperclass
public class Person {
@Id
private long id;
@Column
private String name;
@Column
private int age;
@Column
private List<String> phones;
private String ignore;
public long getId() {
return id;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public List<String> getPhones() {
return phones;
}
public String getIgnore() {
return ignore;
}
Person() {
}
Person(long id, String name, int age, List<String> phones, String ignore) {
this.id = id;
this.name = name;
this.age = age;
this.phones = phones;
this.ignore = ignore;
}
@Override
public String toString() {
return "Person{" + "id=" + id +
", name='" + name + '\'' +
", age=" + age +
", phones=" + phones +
", ignore='" + ignore + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Person person = (Person) o;
return id == person.id &&
age == person.age &&
Objects.equals(name, person.name) &&
Objects.equals(phones, person.phones);
}
@Override
public int hashCode() {
return Objects.hash(id, name, age, phones, ignore);
}
public static PersonBuilder builder() {
return new PersonBuilder();
}
}