19 package org.sleuthkit.datamodel;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.Comparator;
24 import java.util.List;
25 import java.util.Objects;
32 private final String setName;
33 private final long id;
34 private final List<TagName> tagNameList;
42 TagSet(
long id, String setName, List<TagName> tagNameList) {
43 if (setName == null || setName.isEmpty()) {
44 throw new IllegalArgumentException(
"TagSet name must be a non-empty string");
46 this.tagNameList =
new ArrayList<>(tagNameList);
47 this.tagNameList.sort(
new TagNameComparator());
49 this.setName = setName;
67 return Collections.unmodifiableList(tagNameList);
85 if (getClass() != obj.getClass()) {
91 return (this.
id == other.
getId()
92 && setName.equals(other.
getName())
93 && tagNameList.equals(other.tagNameList));
99 hash = 89 * hash + (int) (this.
id ^ (this.
id >>> 32));
100 hash = 89 * hash + Objects.hashCode(this.setName);
101 hash = 89 * hash + Objects.hashCode(this.tagNameList);
109 private class TagNameComparator
implements Comparator<TagName> {
112 int result = ((Integer)tagName1.
getRank()).compareTo(tagName2.
getRank());
boolean equals(Object obj)
List< TagName > getTagNames()