Sleuth Kit Java Bindings (JNI)  4.12.1
Java bindings for using The Sleuth Kit
Attribute.java
Go to the documentation of this file.
1 /*
2  * Sleuth Kit Data Model
3  *
4  * Copyright 2021 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.datamodel;
20 
21 import com.google.common.base.MoreObjects;
22 import java.util.Arrays;
23 import java.util.Objects;
24 
28 public class Attribute extends AbstractAttribute{
29 
33  private long attributeParentId;
34 
38  private long id;
39 
40 
52  public Attribute(BlackboardAttribute.Type attributeType, int valueInt) throws IllegalArgumentException {
53  super(attributeType, valueInt);
54  }
55 
56 
70  public Attribute(BlackboardAttribute.Type attributeType, long valueLong) throws IllegalArgumentException {
71  super(attributeType, valueLong);
72  }
73 
74 
86  public Attribute(BlackboardAttribute.Type attributeType, double valueDouble) throws IllegalArgumentException {
87  super(attributeType, valueDouble);
88  }
89 
90 
102  public Attribute(BlackboardAttribute.Type attributeType, String valueString) throws IllegalArgumentException {
103  super(attributeType, valueString);
104  }
105 
106 
118  public Attribute(BlackboardAttribute.Type attributeType, byte[] valueBytes) throws IllegalArgumentException {
119  super(attributeType, valueBytes);
120  }
121 
138  Attribute(long id, long attributeOwnerId, BlackboardAttribute.Type attributeType,
139  int valueInt, long valueLong, double valueDouble, String valueString, byte[] valueBytes,
140  SleuthkitCase sleuthkitCase) {
141  super(attributeType, valueInt, valueLong, valueDouble, valueString, valueBytes, sleuthkitCase);
142  this.id = id;
143  }
144 
152  final public long getAttributeParentId() {
153  return this.attributeParentId;
154  }
155 
161  final void setAttributeParentId(long attributeParentId) {
162  this.attributeParentId = attributeParentId;
163  }
164 
165 
170  public long getId() {
171  return id;
172  }
173 
174 
179  void setId(long id) {
180  this.id = id;
181  }
182 
183  @Override
184  public int hashCode() {
185  return Objects.hash(
186  this.getAttributeType(), this.getValueInt(), this.getValueLong(), this.getValueDouble(),
187  this.getValueString(), this.getValueBytes());
188  }
189 
190  @Override
191  public boolean equals(Object that) {
192  if (this == that) {
193  return true;
194  } else if (that instanceof Attribute) {
195  return areValuesEqual(that);
196  } else {
197  return false;
198  }
199  }
200 
201  @Override
202  public String toString() {
203  return MoreObjects.toStringHelper(this)
204  .add("attributeType", getAttributeType().toString())
205  .add("valueInt", getValueInt())
206  .add("valueLong", getValueLong())
207  .add("valueDouble", getValueDouble())
208  .add("valueString", getValueString())
209  .add("valueBytes", Arrays.toString(getValueBytes()) )
210  .add("Case", getCaseDatabase())
211  .toString();
212  }
213 }
Attribute(BlackboardAttribute.Type attributeType, long valueLong)
Definition: Attribute.java:70
Attribute(BlackboardAttribute.Type attributeType, int valueInt)
Definition: Attribute.java:52
Attribute(BlackboardAttribute.Type attributeType, double valueDouble)
Definition: Attribute.java:86
Attribute(BlackboardAttribute.Type attributeType, String valueString)
Definition: Attribute.java:102
boolean equals(Object that)
Definition: Attribute.java:191
Attribute(BlackboardAttribute.Type attributeType, byte[] valueBytes)
Definition: Attribute.java:118

Copyright © 2011-2021 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.