Skip to content
Snippets Groups Projects
Commit c3cbe4a9 authored by millmanorama's avatar millmanorama
Browse files

comments

parent 7f2ccc66
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,10 @@
import java.util.HashSet;
import java.util.Set;
/**
* A relationship between Accounts, such as a communication ( email, sms, phone
* call (log) ) or presence in a contact book.
*/
public class Relationship {
public static final class Type {
......@@ -33,12 +37,11 @@ public static final class Type {
private static final Set<Type> PREDEFINED_RELATIONSHIP_TYPES
= Collections.unmodifiableSet(new HashSet<Relationship.Type>(Arrays.asList(
MESSAGE, CALL_LOG, CONTACT
)));
MESSAGE, CALL_LOG, CONTACT)));
private static final Set<Type> PREDEFINED_COMMUNICATION_TYPES
= Collections.unmodifiableSet(new HashSet<Relationship.Type>(Arrays.asList(
MESSAGE, CALL_LOG
)));
MESSAGE, CALL_LOG)));
static Set<Relationship.Type> getPredefinedRelationshipTypes() {
return PREDEFINED_RELATIONSHIP_TYPES;
......@@ -64,7 +67,6 @@ public boolean equals(Object that) {
return false;
}
Type thatType = (Type) that;
// DB table will enforce uniqueness for type name
return this.typeName.equals(thatType.getTypeName());
}
......
/*
* Sleuth Kit Data Model
*
* Copyright 2011-2017 Basis Technology Corp.
* Copyright 2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
......@@ -22,7 +22,6 @@
/**
* Collection of string utility methods.
*
*/
class StringUtils {
......@@ -37,7 +36,18 @@ static <T> String buildCSVString(Collection<T> values) {
return joinAsStrings(values, ",");
}
static <T> String joinAsStrings(Collection<T> values, String seperator) {
/**
* Utility method to join a collection into a string using a supplied
* separator.
*
* @param <T> The type of the values in the collection to be joined
* @param values The collection to be joined
* @param separator The separator to insert between each value in the result
* string
*
* @return a string with the elements of values separated by separator
*/
static <T> String joinAsStrings(Collection<T> values, String separator) {
if (values == null || values.isEmpty()) {
return "";
}
......@@ -45,9 +55,9 @@ static <T> String joinAsStrings(Collection<T> values, String seperator) {
StringBuilder result = new StringBuilder();
for (T val : values) {
result.append(val);
result.append(seperator);
result.append(separator);
}
return result.substring(0, result.lastIndexOf(seperator));
return result.substring(0, result.lastIndexOf(separator));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment