Autopsy  4.1
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 getDataSourceName();
55  }
56 
57  @Override
58  public int hashCode() {
59  int hash = 5;
60  hash = 97 * hash + Objects.hashCode(this.dataSourceName);
61  hash = 97 * hash + (int) (this.dataSourceID ^ (this.dataSourceID >>> 32));
62  return hash;
63  }
64 
65  @Override
66  public boolean equals(Object obj) {
67  if (obj == null) {
68  return false;
69  }
70  if (getClass() != obj.getClass()) {
71  return false;
72  }
73  final DataSourceFilter other = (DataSourceFilter) obj;
74  if (!Objects.equals(this.dataSourceName, other.dataSourceName)) {
75  return false;
76  }
77  if (this.dataSourceID != other.dataSourceID) {
78  return false;
79  }
80  return isSelected() == other.isSelected();
81  }
82 }
DataSourceFilter(String dataSourceName, long dataSourceID)

Copyright © 2012-2016 Basis Technology. Generated on: Tue Oct 25 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.