Autopsy  4.10.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-2018 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;
23 import org.sleuthkit.datamodel.TagName;
24 
28 public class TagNameFilter extends AbstractFilter {
29 
30  private final TagName tagName;
31  private final Case autoCase;
32 
33  public TagNameFilter(TagName tagName, Case autoCase) {
34  this.autoCase = autoCase;
35  this.tagName = tagName;
36  setSelected(Boolean.TRUE);
37  }
38 
39  public TagName getTagName() {
40  return tagName;
41  }
42 
43  @Override
44  synchronized public TagNameFilter copyOf() {
45  TagNameFilter filterCopy = new TagNameFilter(getTagName(), autoCase);
46  filterCopy.setSelected(isSelected());
47  filterCopy.setDisabled(isDisabled());
48  return filterCopy;
49  }
50 
51  @Override
52  public String getDisplayName() {
53  return tagName.getDisplayName();
54  }
55 
56  @Override
57  public int hashCode() {
58  int hash = 3;
59  hash = 53 * hash + Objects.hashCode(this.tagName);
60  return hash;
61  }
62 
63  @Override
64  public boolean equals(Object obj) {
65  if (obj == null) {
66  return false;
67  }
68  if (getClass() != obj.getClass()) {
69  return false;
70  }
71  final TagNameFilter other = (TagNameFilter) obj;
72  if (!Objects.equals(this.tagName, other.tagName)) {
73  return false;
74  }
75 
76  return isSelected() == other.isSelected();
77  }
78 }

Copyright © 2012-2018 Basis Technology. Generated on: Fri Mar 22 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.