Autopsy  4.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DescriptionFilter.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;
22 
23 import org.openide.util.NbBundle;
25 
26 public class DescriptionFilter extends AbstractFilter {
27 
29  private final String description;
30  private final FilterMode filterMode;
31 
33  return filterMode;
34  }
35 
36  public DescriptionFilter(DescriptionLoD descriptionLoD, String description, FilterMode filterMode) {
37  this.descriptionLoD = descriptionLoD;
38  this.description = description;
39  this.filterMode = filterMode;
40  }
41 
42  @Override
45  filterCopy.setSelected(isSelected());
46  filterCopy.setDisabled(isDisabled());
47  return filterCopy;
48  }
49 
50  @Override
51  public String getDisplayName() {
52  return getDescriptionLoD().getDisplayName() + ": " + getDescription();
53  }
54 
55  @Override
56  public String getHTMLReportString() {
57  return getDisplayName() + getStringCheckBox();
58  }
59 
64  return descriptionLoD;
65  }
66 
70  public String getDescription() {
71  return description;
72  }
73 
74  @NbBundle.Messages({"DescriptionFilter.mode.exclude=Exclude",
75  "DescriptionFilter.mode.include=Include"})
76  public enum FilterMode {
77 
78  EXCLUDE(Bundle.DescriptionFilter_mode_exclude()),
79  INCLUDE(Bundle.DescriptionFilter_mode_include());
80 
81  private final String displayName;
82 
83  private FilterMode(String displayName) {
84  this.displayName = displayName;
85  }
86 
87  private String getDisplayName() {
88  return displayName;
89  }
90  }
91 
92  @Override
93  public int hashCode() {
94  int hash = 7;
95  hash = 79 * hash + Objects.hashCode(this.descriptionLoD);
96  hash = 79 * hash + Objects.hashCode(this.description);
97  hash = 79 * hash + Objects.hashCode(this.filterMode);
98  return hash;
99  }
100 
101  @Override
102  public boolean equals(Object obj) {
103  if (obj == null) {
104  return false;
105  }
106  if (getClass() != obj.getClass()) {
107  return false;
108  }
109  final DescriptionFilter other = (DescriptionFilter) obj;
110  if (this.descriptionLoD != other.descriptionLoD) {
111  return false;
112  }
113  if (!Objects.equals(this.description, other.description)) {
114  return false;
115  }
116  if (this.filterMode != other.filterMode) {
117  return false;
118  }
119  return true;
120  }
121 }
DescriptionFilter(DescriptionLoD descriptionLoD, String description, FilterMode filterMode)

Copyright © 2012-2015 Basis Technology. Generated on: Wed Apr 6 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.