19 package org.sleuthkit.datamodel;
21 import java.util.Arrays;
22 import java.util.Collections;
23 import static java.util.Collections.singleton;
24 import java.util.HashMap;
25 import java.util.HashSet;
39 public static final class Type {
41 private final String displayName;
42 private final String typeName;
43 private final int typeID;
49 private final static HashMap<Type, Set<Integer>> typesToArtifactTypeIDs =
new HashMap<Type, Set<Integer>>();
52 typesToArtifactTypeIDs.put(
MESSAGE, hashSetOf(
53 TSK_EMAIL_MSG.getTypeID(),
54 TSK_MESSAGE.getTypeID()));
55 typesToArtifactTypeIDs.put(
CALL_LOG, singleton(
56 TSK_CALLLOG.getTypeID()));
57 typesToArtifactTypeIDs.put(
CONTACT, singleton(
58 TSK_CONTACT.getTypeID()));
61 private static final Set<Type> PREDEFINED_COMMUNICATION_TYPES
62 = Collections.unmodifiableSet(
new HashSet<Relationship.Type>(Arrays.asList(
72 return PREDEFINED_COMMUNICATION_TYPES;
75 private Type(String name, String displayName,
int id) {
77 this.displayName = displayName;
111 hash = 37 * hash + (this.typeName != null ? this.typeName.hashCode() : 0);
112 hash = 37 * hash + this.typeID;
124 if (getClass() != obj.getClass()) {
128 if (this.typeID != other.typeID) {
131 if ((this.typeName == null) ? (other.typeName != null) : !this.typeName.equals(other.typeName)) {
139 return "{" + this.getClass().getName() +
": typeID=" + typeName +
", displayName=" + this.displayName +
", typeName=" + this.typeName +
"}";
153 Set<Integer>
get = typesToArtifactTypeIDs.get(
this);
boolean equals(Object obj)
static final Relationship.Type CALL_LOG
static final Relationship.Type MESSAGE
static final Relationship.Type CONTACT