Sleuth Kit Java Bindings (JNI) 4.14.0
Java bindings for using The Sleuth Kit
Loading...
Searching...
No Matches
Person.java
Go to the documentation of this file.
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 */
19package org.sleuthkit.datamodel;
20
21import java.util.Objects;
22
26public final class Person {
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
41 public long getPersonId() {
42 return id;
43 }
44
50 public String getName() {
51 return name;
52 }
53
59 public void setName(String newName) {
60 this.name = newName;
61 }
62
63 @Override
64 public int hashCode() {
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
72 public boolean equals(Object obj) {
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
83 final Person other = (Person) obj;
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}
boolean equals(Object obj)
Definition Person.java:72
void setName(String newName)
Definition Person.java:59

Copyright © 2011-2024 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.