Package org.spdx.core
Class SimpleUriValue
- java.lang.Object
-
- org.spdx.core.SimpleUriValue
-
- All Implemented Interfaces:
IndividualUriValue
public class SimpleUriValue extends Object implements IndividualUriValue
Simple class to just store a URI valueThe method toModelObject will convert / inflate the value back to either an Enum (if the URI matches), an ExternalSpdxElement if it matches the pattern of an external SPDX element or returns itself otherwise
- Author:
- Gary O'Neall
-
-
Constructor Summary
Constructors Constructor Description SimpleUriValue(String uri)
SimpleUriValue(IndividualUriValue fromIndividualValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object comp)
String
getIndividualURI()
static int
getIndividualUriValueHash(IndividualUriValue individualUri)
returns hash based on URI of the IndividualUriValueint
hashCode()
static boolean
isIndividualUriValueEquals(IndividualUriValue individualUri, Object comp)
Compares an object to an individual URI and returns true if the URI values are equalObject
toModelObject(IModelStore store, IModelCopyManager copyManager, String specVersion, Class<?> type)
inflate the value back to either an Enum (if the URI matches), an Individual (if the URI matches), the modelObject (if the store contains the object matching the URI), or an ExternalObject if not in the store
-
-
-
Constructor Detail
-
SimpleUriValue
public SimpleUriValue(IndividualUriValue fromIndividualValue)
- Parameters:
fromIndividualValue
- individual value to copy the URI from
-
SimpleUriValue
public SimpleUriValue(String uri)
- Parameters:
uri
- URI for the value
-
-
Method Detail
-
getIndividualUriValueHash
public static int getIndividualUriValueHash(IndividualUriValue individualUri)
returns hash based on URI of the IndividualUriValue- Parameters:
individualUri
- IndividualUriValue to obtain a hash from- Returns:
- hash based on URI of the IndividualUriValue
-
isIndividualUriValueEquals
public static boolean isIndividualUriValueEquals(IndividualUriValue individualUri, Object comp)
Compares an object to an individual URI and returns true if the URI values are equal- Parameters:
individualUri
- IndividualUriValue to comparecomp
- Object to compare- Returns:
- true if the individualUri has the same URI as comp and comp is of type IndividualUriValue
-
getIndividualURI
public String getIndividualURI()
- Specified by:
getIndividualURI
in interfaceIndividualUriValue
- Returns:
- a unique identifier for this value. Typically the namespace + the long name
-
toModelObject
public Object toModelObject(IModelStore store, IModelCopyManager copyManager, String specVersion, @Nullable Class<?> type) throws InvalidSPDXAnalysisException
inflate the value back to either an Enum (if the URI matches), an Individual (if the URI matches), the modelObject (if the store contains the object matching the URI), or an ExternalObject if not in the store- Parameters:
store
- store to use for the inflated objectcopyManager
- if non-null, implicitly copy any referenced properties from other model storesspecVersion
- version of the SPDX spec the object complies withtype
- optional type hint - used for individuals where the type may be ambiguous- Returns:
- Enum, ExternalSpdxElement or itself depending on the pattern
- Throws:
InvalidSPDXAnalysisException
- on any store or parsing error
-
-