Autopsy  4.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DataSourceFilter.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 
26 public class DataSourceFilter extends AbstractFilter {
27 
28  private final String dataSourceName;
29  private final long dataSourceID;
30 
31  public long getDataSourceID() {
32  return dataSourceID;
33  }
34 
35  public String getDataSourceName() {
36  return dataSourceName;
37  }
38 
39  public DataSourceFilter(String dataSourceName, long dataSourceID) {
40  this.dataSourceName = dataSourceName;
41  this.dataSourceID = dataSourceID;
42  }
43 
44  @Override
45  synchronized public DataSourceFilter copyOf() {
47  filterCopy.setSelected(isSelected());
48  filterCopy.setDisabled(isDisabled());
49  return filterCopy;
50  }
51 
52  @Override
53  public String getDisplayName() {
54  return dataSourceName;
55  }
56 
57  @Override
58  public String getHTMLReportString() {
59  return getDisplayName() + getStringCheckBox();
60  }
61 
62  @Override
63  public int hashCode() {
64  int hash = 5;
65  hash = 97 * hash + Objects.hashCode(this.dataSourceName);
66  hash = 97 * hash + (int) (this.dataSourceID ^ (this.dataSourceID >>> 32));
67  return hash;
68  }
69 
70  @Override
71  public boolean equals(Object obj) {
72  if (obj == null) {
73  return false;
74  }
75  if (getClass() != obj.getClass()) {
76  return false;
77  }
78  final DataSourceFilter other = (DataSourceFilter) obj;
79  if (!Objects.equals(this.dataSourceName, other.dataSourceName)) {
80  return false;
81  }
82  if (this.dataSourceID != other.dataSourceID) {
83  return false;
84  }
85  return isSelected() == other.isSelected();
86  }
87 }
DataSourceFilter(String dataSourceName, long dataSourceID)

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.