Autopsy  3.1
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 
52  KeywordList(List<Keyword> keywords) {
53  this("", new Date(0), new Date(0), false, false, keywords, false);
54  }
55 
56  @Override
57  public boolean equals(Object obj) {
58  if (obj == null) {
59  return false;
60  }
61  if (getClass() != obj.getClass()) {
62  return false;
63  }
64  final KeywordList other = (KeywordList) obj;
65  if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
66  return false;
67  }
68  return true;
69  }
70 
71  @Override
72  public int hashCode() {
73  int hash = 5;
74  return hash;
75  }
76 
77  String getName() {
78  return name;
79  }
80 
81  Date getDateCreated() {
82  return created;
83  }
84 
85  Date getDateModified() {
86  return modified;
87  }
88 
89  Boolean getUseForIngest() {
90  return useForIngest;
91  }
92 
93  void setUseForIngest(boolean use) {
94  this.useForIngest = use;
95  }
96 
97  Boolean getIngestMessages() {
98  return ingestMessages;
99  }
100 
101  void setIngestMessages(boolean ingestMessages) {
102  this.ingestMessages = ingestMessages;
103  }
104 
105  List<Keyword> getKeywords() {
106  return keywords;
107  }
108 
109  boolean hasKeyword(Keyword keyword) {
110  return keywords.contains(keyword);
111  }
112 
113  boolean hasKeyword(String keyword) {
114  //note, this ignores isLiteral
115  for (Keyword k : keywords) {
116  if (k.getQuery().equals(keyword)) {
117  return true;
118  }
119  }
120  return false;
121  }
122 
123  Boolean isLocked() {
124  return locked;
125  }
126 }

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