Skip to content
Snippets Groups Projects
Commit 2127f6f7 authored by Raman Arora's avatar Raman Arora
Browse files

6128: Type match exception for TSK_COUNT attribute.

parent 095e0dfd
No related branches found
No related tags found
No related merge requests found
/* /*
* Sleuth Kit Data Model * Sleuth Kit Data Model
* *
* Copyright 2019 Basis Technology Corp. * Copyright 2019-2020 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -75,11 +75,11 @@ String getModuleName() { ...@@ -75,11 +75,11 @@ String getModuleName() {
} }
/** /**
* Creates and adds an attribute of specified type to the given list, if the * Creates and adds a string attribute of specified type to the given list, if the
* attribute value is not empty or null. * attribute value is not empty or null.
* *
* @param attributeType Attribute type. * @param attributeType Attribute type.
* @param attrValue Attribute value. * @param attrValue String attribute value.
* @param attributes List of attributes to add to. * @param attributes List of attributes to add to.
* *
*/ */
...@@ -90,11 +90,11 @@ void addAttributeIfNotNull(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, Str ...@@ -90,11 +90,11 @@ void addAttributeIfNotNull(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, Str
} }
/** /**
* Creates and adds an attribute of specified type to the given list, if the * Creates and adds a long attribute of specified type to the given list, if the
* attribute value is not 0. * attribute value is not 0.
* *
* @param attributeType Attribute type. * @param attributeType Attribute type.
* @param attrValue Attribute value. * @param attrValue Long attribute value.
* @param attributes List of attributes to add to. * @param attributes List of attributes to add to.
*/ */
void addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, long attrValue, Collection<BlackboardAttribute> attributes) { void addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, long attrValue, Collection<BlackboardAttribute> attributes) {
...@@ -102,4 +102,18 @@ void addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, lon ...@@ -102,4 +102,18 @@ void addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, lon
attributes.add(new BlackboardAttribute(attributeType, getModuleName(), attrValue)); attributes.add(new BlackboardAttribute(attributeType, getModuleName(), attrValue));
} }
} }
/**
* Creates and adds an integer attribute of specified type to the given list, if the
* attribute value is not 0.
*
* @param attributeType Attribute type.
* @param attrValue Integer attribute value.
* @param attributes List of attributes to add to.
*/
void addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, int attrValue, Collection<BlackboardAttribute> attributes) {
if (attrValue > 0) {
attributes.add(new BlackboardAttribute(attributeType, getModuleName(), attrValue));
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment