Class Relationship

    • Constructor Detail

      • Relationship

        public Relationship()
                     throws org.spdx.core.InvalidSPDXAnalysisException
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • Relationship

        public Relationship​(String id)
                     throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        id - identifier
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • Relationship

        public Relationship​(org.spdx.storage.IModelStore modelStore,
                            String documentUri,
                            String id,
                            org.spdx.core.IModelCopyManager copyManager,
                            boolean create)
                     throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        modelStore - container which includes the model data
        documentUri - URI for the SPDX document containing the model data
        id - identifier
        copyManager - if non-null, allows for copying of any properties set which use other model stores or document URI's
        create - if true, create the license if it does not exist
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
    • Method Detail

      • getType

        public String getType()
        Specified by:
        getType in class org.spdx.core.CoreModelObject
      • _verify

        protected List<String> _verify​(Set<String> verifiedIds,
                                       String specVersion)
        Description copied from class: ModelObjectV2
        Implementation of the specific verifications for this model object
        Specified by:
        _verify in class ModelObjectV2
        Parameters:
        verifiedIds - list of all Element Id's which have already been verified - prevents infinite recursion
        specVersion - Version of the SPDX spec to verify against
        Returns:
        Any verification errors or warnings associated with this object
      • getRelationshipType

        public RelationshipType getRelationshipType()
                                             throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the relationshipType
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setRelationshipType

        public Relationship setRelationshipType​(RelationshipType type)
                                         throws org.spdx.core.InvalidSPDXAnalysisException
        Set the relationship type
        Parameters:
        type -
        Returns:
        this to chain setters
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getComment

        public Optional<String> getComment()
                                    throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the comment
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setComment

        public Relationship setComment​(String comment)
                                throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        comment - the comment to set
        Returns:
        this to chain setters
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getRelatedSpdxElement

        public Optional<SpdxElement> getRelatedSpdxElement()
                                                    throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the relatedSpdxElement
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setRelatedSpdxElement

        public Relationship setRelatedSpdxElement​(SpdxElement relatedSpdxElement)
                                           throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        relatedSpdxElement - the relatedSpdxElement to set
        Returns:
        this to chain setters
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException