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

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.