1 /*
2 * Sleuth Kit Data Model
3 *
4 * Copyright 2016-18 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.Arrays;
22 import java.util.List;
23
31
35 private final long account_id;
36
42 private final String typeSpecificID;
43
44 public static final class Type {
45
46 //JIRA-900:Should the display names of predefined types be internationalized?
57
65
69
91 );
92
93 private final String typeName;
94 private final String displayName;
95
102 public Type(String typeName, String displayName) {
103 this.typeName = typeName;
104 this.displayName = displayName;
105 }
106
113 return this.typeName;
114 }
115
122 return displayName;
123 }
124
125 @Override
127 if (this == that) {
128 return true;
130 return false;
131 }
132
134 // DB table enforces uniqueness for type name
135 return this.typeName.
equals(thatType.getTypeName());
136 }
137
138 @Override
140 int hash = 11;
141
142 hash = 83 * hash + (this.typeName != null ? this.typeName.hashCode() : 0);
143 hash = 83 * hash + (this.displayName != null ? this.displayName.hashCode() : 0);
144
145 return hash;
146 }
147
148 @Override
150 return " displayName=" + this.displayName
151 + ", typeName=" + this.typeName + ")";
152 }
153 }
154
156 this.account_id = account_id;
157 this.accountType = accountType;
158 this.typeSpecificID = typeSpecificId;
159 }
160
168 return this.typeSpecificID;
169 }
170
177 return this.accountType;
178 }
179
187 return this.account_id;
188 }
189
190 @Override
192 int hash = 5;
193 hash = 43 * hash + (int) (this.account_id ^ (this.account_id >>> 32));
194 hash = 43 * hash + (this.accountType != null ? this.accountType.
hashCode() : 0);
195 hash = 43 * hash + (this.typeSpecificID != null ? this.typeSpecificID.hashCode() : 0);
196 return hash;
197 }
198
199 @Override
201 if (this == obj) {
202 return true;
203 }
204 if (obj == null) {
205 return false;
206 }
207 if (getClass() != obj.getClass()) {
208 return false;
209 }
211 if (this.account_id != other.account_id) {
212 return false;
213 }
214 if ((this.typeSpecificID == null) ? (other.typeSpecificID != null) : !this.typeSpecificID.equals(other.typeSpecificID)) {
215 return false;
216 }
217 if (this.accountType != other.accountType && (this.accountType == null || !this.accountType.equals(other.accountType))) {
218 return false;
219 }
220 return true;
221 }
222 }
boolean equals(Object that)
static final Account.Type TANGO
static final Account.Type INSTAGRAM
static final Account.Type MESSAGING_APP
static final Account.Type TEXTNOW
static final Account.Type WHATSAPP
static final Account.Type FACEBOOK
static final Account.Type ZAPYA
String getTypeSpecificID()
static final Account.Type PHONE
static final Account.Type IMO
static final Account.Type XENDER
static final Account.Type WEBSITE
static final Account.Type CREDIT_CARD
boolean equals(Object obj)
static final List< Account.Type > PREDEFINED_ACCOUNT_TYPES
static final Account.Type LINE
static final Account.Type TWITTER
Account.Type getAccountType()
static final Account.Type VIBER
static final Account.Type SHAREIT
static final Account.Type THREEMA
static final Account.Type SKYPE
static final Account.Type DEVICE
static final Account.Type EMAIL
Type(String typeName, String displayName)