1 /*
2 * Sleuth Kit Data Model
3 *
4 * Copyright 2021 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19 package org.sleuthkit.datamodel;
20
21 import java.util.Objects;
22
27
28 private final long id;
29 private String name;
30
31 Person(
long id, String name) {
32 this.id = id;
33 this.name = name;
34 }
35
42 return id;
43 }
44
51 return name;
52 }
53
60 this.name = newName;
61 }
62
63 @Override
65 int hash = 5;
66 hash = 67 * hash + (int) (this.id ^ (this.id >>> 32));
67 hash = 67 * hash + Objects.hashCode(this.name);
68 return hash;
69 }
70
71 @Override
73 if (this == obj) {
74 return true;
75 }
76 if (obj == null) {
77 return false;
78 }
79 if (getClass() != obj.getClass()) {
80 return false;
81 }
82
84 if (this.id != other.id) {
85 return false;
86 }
87
88 if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
89 return false;
90 }
91
92 return true;
93 }
94
95 }
void setName(String newName)
boolean equals(Object obj)