19 package org.sleuthkit.autopsy.keywordsearch;
34 private String searchTerm;
35 private boolean isLiteral;
36 private boolean isWholeWord;
37 private BlackboardAttribute.ATTRIBUTE_TYPE artifactAtrributeType;
48 Keyword(String searchTerm,
boolean isLiteral) {
49 this.searchTerm = searchTerm;
50 this.isLiteral = isLiteral;
51 this.isWholeWord =
true;
66 Keyword(String searchTerm,
boolean isLiteral,
boolean isWholeWord) {
67 this.searchTerm = searchTerm;
68 this.isLiteral = isLiteral;
69 this.isWholeWord = isWholeWord;
86 Keyword(String searchTerm,
boolean isLiteral, BlackboardAttribute.ATTRIBUTE_TYPE artifactAtrributeType) {
87 this(searchTerm, isLiteral);
88 this.artifactAtrributeType = artifactAtrributeType;
97 String getSearchTerm() {
107 boolean searchTermIsLiteral() {
118 boolean searchTermIsWholeWord() {
131 void setArtifactAttributeType(BlackboardAttribute.ATTRIBUTE_TYPE artifactAtrributeType) {
132 this.artifactAtrributeType = artifactAtrributeType;
144 BlackboardAttribute.ATTRIBUTE_TYPE getArtifactAttributeType() {
145 return this.artifactAtrributeType;
149 public String toString() {
150 return String.format(
"Keyword{searchTerm='%s', isLiteral=%s, isWholeWord=%s}", searchTerm, isLiteral, isWholeWord);
154 public boolean equals(Object obj) {
158 if (getClass() != obj.getClass()) {
161 Keyword other = (Keyword) obj;
162 return (this.searchTerm.equals(other.searchTerm)
163 && this.isLiteral == other.isLiteral
164 && this.isWholeWord == other.isWholeWord);
168 public int hashCode() {
170 hash = 17 * hash + this.searchTerm.hashCode();
171 hash = 17 * hash + (this.isLiteral ? 1 : 0);
172 hash = 17 * hash + (this.isWholeWord ? 1 : 0);