Autopsy  4.5.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
TagNameFilter.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2015 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.autopsy.timeline.filters;
20 
21 import java.util.Objects;
24 import org.sleuthkit.datamodel.SleuthkitCase;
25 import org.sleuthkit.datamodel.TagName;
26 
30 public class TagNameFilter extends AbstractFilter {
31 
32  private final TagName tagName;
33  private final Case autoCase;
34  private final TagsManager tagsManager;
35  private final SleuthkitCase sleuthkitCase;
36 
37  public TagNameFilter(TagName tagName, Case autoCase) {
38  this.autoCase = autoCase;
39  sleuthkitCase = autoCase.getSleuthkitCase();
40  tagsManager = autoCase.getServices().getTagsManager();
41  this.tagName = tagName;
42  setSelected(Boolean.TRUE);
43  }
44 
45  public TagName getTagName() {
46  return tagName;
47  }
48 
49  @Override
50  synchronized public TagNameFilter copyOf() {
51  TagNameFilter filterCopy = new TagNameFilter(getTagName(), autoCase);
52  filterCopy.setSelected(isSelected());
53  filterCopy.setDisabled(isDisabled());
54  return filterCopy;
55  }
56 
57  @Override
58  public String getDisplayName() {
59  return tagName.getDisplayName();
60  }
61 
62  @Override
63  public int hashCode() {
64  int hash = 3;
65  hash = 53 * hash + Objects.hashCode(this.tagName);
66  return hash;
67  }
68 
69  @Override
70  public boolean equals(Object obj) {
71  if (obj == null) {
72  return false;
73  }
74  if (getClass() != obj.getClass()) {
75  return false;
76  }
77  final TagNameFilter other = (TagNameFilter) obj;
78  if (!Objects.equals(this.tagName, other.tagName)) {
79  return false;
80  }
81 
82  return isSelected() == other.isSelected();
83  }
84 }

Copyright © 2012-2016 Basis Technology. Generated on: Tue Feb 20 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.