Autopsy  4.19.3
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 2018-2019 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.ui.filtering.datamodel;
20 
21 import java.util.Objects;
22 import org.sleuthkit.datamodel.TimelineEvent;
23 import org.sleuthkit.datamodel.TimelineLevelOfDetail;
24 
28 public final class DescriptionFilter implements UIFilter {
29 
30  private final TimelineLevelOfDetail descriptionLoD;
31  private final String description;
32 
33  public DescriptionFilter(TimelineLevelOfDetail descriptionLoD, String description) {
34  super();
35  this.descriptionLoD = descriptionLoD;
36  this.description = description;
37  }
38 
39  public TimelineLevelOfDetail getDescriptionLevel() {
40  return descriptionLoD;
41  }
42 
46  public String getDescription() {
47  return description;
48  }
49 
50  @Override
51  public int hashCode() {
52  int hash = 7;
53  hash = 23 * hash + Objects.hashCode(this.descriptionLoD);
54  hash = 23 * hash + Objects.hashCode(this.description);
55  return hash;
56  }
57 
58  @Override
59  public boolean equals(Object obj) {
60  if (this == obj) {
61  return true;
62  }
63  if (obj == null) {
64  return false;
65  }
66  if (getClass() != obj.getClass()) {
67  return false;
68  }
69  final DescriptionFilter other = (DescriptionFilter) obj;
70  if (!Objects.equals(this.description, other.description)) {
71  return false;
72  }
73  return this.descriptionLoD == other.descriptionLoD;
74  }
75 
76  @Override
77  public boolean test(TimelineEvent event) {
78  return event.getDescription(descriptionLoD).equalsIgnoreCase(description);
79  }
80 }
DescriptionFilter(TimelineLevelOfDetail descriptionLoD, String description)

Copyright © 2012-2022 Basis Technology. Generated on: Thu Dec 8 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.