Autopsy  4.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
KeywordList.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2014 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.keywordsearch;
20 
21 import java.util.Date;
22 import java.util.List;
23 
24 public class KeywordList {
25 
26  private String name;
27  private Date created;
28  private Date modified;
29  private Boolean useForIngest;
30  private Boolean ingestMessages;
31  private List<Keyword> keywords;
32  private Boolean locked;
33 
34  KeywordList(String name, Date created, Date modified, Boolean useForIngest, Boolean ingestMessages, List<Keyword> keywords, boolean locked) {
35  this.name = name;
36  this.created = created;
37  this.modified = modified;
38  this.useForIngest = useForIngest;
39  this.ingestMessages = ingestMessages;
40  this.keywords = keywords;
41  this.locked = locked;
42  }
43 
44  KeywordList(String name, Date created, Date modified, Boolean useForIngest, Boolean ingestMessages, List<Keyword> keywords) {
46  }
47 
53  KeywordList(List<Keyword> keywords) {
54  this("", new Date(0), new Date(0), false, false, keywords, false);
55  }
56 
57  @Override
58  public boolean equals(Object obj) {
59  if (obj == null) {
60  return false;
61  }
62  if (getClass() != obj.getClass()) {
63  return false;
64  }
65  final KeywordList other = (KeywordList) obj;
66  if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
67  return false;
68  }
69  return true;
70  }
71 
72  @Override
73  public int hashCode() {
74  int hash = 5;
75  return hash;
76  }
77 
78  String getName() {
79  return name;
80  }
81 
82  Date getDateCreated() {
83  return created;
84  }
85 
86  Date getDateModified() {
87  return modified;
88  }
89 
90  Boolean getUseForIngest() {
91  return useForIngest;
92  }
93 
94  void setUseForIngest(boolean use) {
95  this.useForIngest = use;
96  }
97 
98  Boolean getIngestMessages() {
99  return ingestMessages;
100  }
101 
102  void setIngestMessages(boolean ingestMessages) {
103  this.ingestMessages = ingestMessages;
104  }
105 
106  List<Keyword> getKeywords() {
107  return keywords;
108  }
109 
110  boolean hasKeyword(Keyword keyword) {
111  return keywords.contains(keyword);
112  }
113 
114  boolean hasKeyword(String keyword) {
115  //note, this ignores isLiteral
116  for (Keyword k : keywords) {
117  if (k.getQuery().equals(keyword)) {
118  return true;
119  }
120  }
121  return false;
122  }
123 
124  Boolean isLocked() {
125  return locked;
126  }
127 }

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.