Class StoredTypedItem

java.lang.Object
org.spdx.library.model.TypedValue
org.spdx.storage.simple.StoredTypedItem

public class StoredTypedItem extends TypedValue
Individual item to be stored in memory
Author:
Gary O'Neall
  • Constructor Details

  • Method Details

    • getPropertyValueNames

      public List<String> getPropertyValueNames()
      Returns:
      Property names for all properties having a value
    • incReferenceCount

      public int incReferenceCount()
      Increment the reference count for this stored type item - the number of times this item is referenced
      Returns:
      new number of times this item is referenced
    • decReferenceCount

      public int decReferenceCount() throws SpdxInvalidTypeException
      Decrement the reference count for this stored type item
      Returns:
      new number of times this item is referenced
      Throws:
      SpdxInvalidTypeException
    • getReferenceCount

      public int getReferenceCount() throws SpdxInvalidTypeException
      Returns:
      new number of times this item is referenced
      Throws:
      SpdxInvalidTypeException
    • setValue

      public void setValue(String propertyName, Object value) throws SpdxInvalidTypeException
      Parameters:
      propertyName - Name of the property
      value - Value to be set
      Throws:
      SpdxInvalidTypeException
    • clearPropertyValueList

      public void clearPropertyValueList(String propertyName) throws SpdxInvalidTypeException
      Sets the value list for the property to an empty list creating the propertyName if it does not exist
      Parameters:
      propertyName - Name of the property
      Throws:
      SpdxInvalidTypeException
    • addValueToList

      public boolean addValueToList(String propertyName, Object value) throws SpdxInvalidTypeException
      Adds a value to a property list for a String or Boolean type of value creating the propertyName if it does not exist
      Parameters:
      propertyName - Name of the property
      value - Value to be set
      Throws:
      SpdxInvalidTypeException
    • removeTypedValueFromList

      public boolean removeTypedValueFromList(String propertyName, TypedValue value) throws SpdxInvalidTypeException
      Throws:
      SpdxInvalidTypeException
    • removeValueFromList

      public boolean removeValueFromList(String propertyName, Object value) throws SpdxInvalidTypeException
      Removes a property from a list if it exists
      Parameters:
      propertyName -
      value -
      Throws:
      SpdxInvalidTypeException
    • getValueList

      public Iterator<Object> getValueList(String propertyName) throws SpdxInvalidTypeException
      Parameters:
      propertyName - Name of the property
      Returns:
      List of values associated with the id, propertyName and document
      Throws:
      SpdxInvalidTypeException
    • getValue

      public Object getValue(String propertyName)
      Parameters:
      propertyName - Name of the property
      Returns:
      the single value associated with the id, propertyName and document
    • removeProperty

      public void removeProperty(String propertyName)
      Removes a property from the document for the given ID if the property exists. Does not raise any exception if the propertyName does not exist
      Parameters:
      propertyName - Name of the property
    • copyValuesFrom

      public void copyValuesFrom(String fromDocumentUri, IModelStore store) throws InvalidSPDXAnalysisException
      Copy all values for this item from another store
      Parameters:
      fromDocumentUri -
      store -
      Throws:
      InvalidSPDXAnalysisException
    • collectionSize

      public int collectionSize(String propertyName) throws SpdxInvalidTypeException
      Parameters:
      propertyName -
      Returns:
      Size of the collection
      Throws:
      SpdxInvalidTypeException
    • collectionContains

      public boolean collectionContains(String propertyName, Object value) throws SpdxInvalidTypeException
      Parameters:
      propertyName - property name
      value - value to be checked
      Returns:
      true if value is in the list associated with the property name
      Throws:
      SpdxInvalidTypeException
    • isCollectionMembersAssignableTo

      public boolean isCollectionMembersAssignableTo(String propertyName, Class<?> clazz)
    • isPropertyValueAssignableTo

      public boolean isPropertyValueAssignableTo(String propertyName, Class<?> clazz)
    • isCollectionProperty

      public boolean isCollectionProperty(String propertyName)
      Parameters:
      propertyName - property name
      Returns:
      true if there is a list associated with the property name
    • usesId

      public boolean usesId(String elementId)
      Parameters:
      elementId - id for the element to check
      Returns:
      true if an element using the id is used as a value in a collection