org.squashtest.tm.domain.requirement
Class RequirementVersion

java.lang.Object
  extended by org.squashtest.tm.domain.resource.Resource
      extended by org.squashtest.tm.domain.requirement.RequirementVersion
All Implemented Interfaces:
AttachmentHolder, BoundEntity, Identified

@Entity
public class RequirementVersion
extends Resource
implements BoundEntity

Represents a version of a requirement.

Author:
Gregory Fouquet

Constructor Summary
RequirementVersion()
           
 
Method Summary
 void addRequirementCoverage(RequirementVersionCoverage coverage)
          Simply add the coverage to this.requirementVersionCoverage
 void checkLinkable()
           
static RequirementVersion createFromMemento(RequirementVersionImportMemento memento)
          Factory methiod which creates a RequirementVersion from a memento objet which holds the new object's target state.
 RequirementVersion createPastableCopy()
          Will create a copy of the requirement version with all attributes, and attachments.
 List<RequirementVersionCoverage> createRequirementVersionCoveragesForCopy(RequirementVersion copyVersion)
          Will create a copy of this.requirementVersionCoverages.
 Long getBoundEntityId()
           
 BindableEntity getBoundEntityType()
           
 RequirementCategory getCategory()
           
 RequirementCriticality getCriticality()
           
 Project getProject()
           
 String getReference()
           
 Requirement getRequirement()
           
 RequirementVersionCoverage getRequirementVersionCoverageOrNullFor(TestCase testCase)
           
 Set<RequirementVersionCoverage> getRequirementVersionCoverages()
           
 RequirementStatus getStatus()
           
 Set<TestCase> getVerifyingTestCases()
          Returns an UNMODIFIABLE VIEW of the verifying test cases.
 int getVersionNumber()
           
 boolean isLinkable()
           
 boolean isModifiable()
          Tells if this requirement's "intrinsic" properties can be modified.
 boolean isNotObsolete()
           
 void removeRequirementVersionCoverage(RequirementVersionCoverage requirementVersionCoverage)
          Simply remove the RequirementVersionCoverage from this.requirementVersionCoverages.
 void setCategory(RequirementCategory category)
          Set the requirement category
 void setCriticality(RequirementCriticality criticality)
          Set the requirement criticality
 void setDescription(String description)
           
 void setName(String name)
           
 void setReference(String reference)
          Set the requirement reference
 void setRequirementVersionCoverages(Set<RequirementVersionCoverage> requirementVersionCoverages)
           
 void setStatus(RequirementStatus status)
          Sets this object's status, following status transition rules.
protected  void setVersionNumber(int versionNumber)
           
 
Methods inherited from class org.squashtest.tm.domain.resource.Resource
equals, getAttachmentList, getDescription, getId, getName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequirementVersion

public RequirementVersion()
Method Detail

setName

public void setName(String name)
Overrides:
setName in class Resource

setDescription

public void setDescription(String description)
Overrides:
setDescription in class Resource

getVerifyingTestCases

public Set<TestCase> getVerifyingTestCases()
Returns an UNMODIFIABLE VIEW of the verifying test cases.


checkLinkable

public void checkLinkable()
Throws:
RequirementVersionNotLinkableException

getReference

public String getReference()
Returns:
the reference of the requirement

setReference

public void setReference(String reference)
Set the requirement reference

Parameters:
reference -

getCriticality

public RequirementCriticality getCriticality()
Returns:
the requirement criticality

setCriticality

public void setCriticality(RequirementCriticality criticality)
Set the requirement criticality

Parameters:
criticality -

getCategory

public RequirementCategory getCategory()
Returns:
the requirement category

setCategory

public void setCategory(RequirementCategory category)
Set the requirement category

Parameters:
category -

setStatus

public void setStatus(RequirementStatus status)
Sets this object's status, following status transition rules.

Parameters:
status -

getStatus

public RequirementStatus getStatus()

isLinkable

public boolean isLinkable()
Returns:
true if this requirement can be (un)linked by new verifying testcases

isModifiable

public boolean isModifiable()
Tells if this requirement's "intrinsic" properties can be modified. The following are not considered as "intrinsic" properties" : #verifyingTestCases are governed by the isLinkable() state, status is governed by itself.

Returns:
true if this requirement's properties can be modified.

getRequirement

public Requirement getRequirement()
Returns:
the requirement

getVersionNumber

public int getVersionNumber()
Returns:
the versionNumber

setVersionNumber

protected void setVersionNumber(int versionNumber)

createPastableCopy

public RequirementVersion createPastableCopy()
Will create a copy of the requirement version with all attributes, and attachments. Does not copy requirementVersionCoverages.

Returns:
the requirement-version copy.

isNotObsolete

public boolean isNotObsolete()

createFromMemento

public static RequirementVersion createFromMemento(@NotNull
                                                   RequirementVersionImportMemento memento)
Factory methiod which creates a RequirementVersion from a memento objet which holds the new object's target state. This method overrides any RequirementStatus workflow check.

Parameters:
memento -
Returns:

getBoundEntityId

public Long getBoundEntityId()
Specified by:
getBoundEntityId in interface BoundEntity

getBoundEntityType

public BindableEntity getBoundEntityType()
Specified by:
getBoundEntityType in interface BoundEntity

getProject

public Project getProject()
Specified by:
getProject in interface BoundEntity

addRequirementCoverage

public void addRequirementCoverage(RequirementVersionCoverage coverage)
Simply add the coverage to this.requirementVersionCoverage

Parameters:
coverage -

getRequirementVersionCoverageOrNullFor

public RequirementVersionCoverage getRequirementVersionCoverageOrNullFor(TestCase testCase)

removeRequirementVersionCoverage

public void removeRequirementVersionCoverage(RequirementVersionCoverage requirementVersionCoverage)
Simply remove the RequirementVersionCoverage from this.requirementVersionCoverages.

Parameters:
requirementVersionCoverage - : the entity to remove from this requirement version's RequirementVersionCoverages list.
Throws:
RequirementVersionNotLinkableException

createRequirementVersionCoveragesForCopy

public List<RequirementVersionCoverage> createRequirementVersionCoveragesForCopy(RequirementVersion copyVersion)
Will create a copy of this.requirementVersionCoverages. Each RequirementVersionCoverage having, instead of this the copyVersion param as their verifiedRequirementVersion.

Parameters:
copyVersion -
Returns:
the copies of RequirementVersionCoverages
Throws:
RequirementVersionNotLinkableException
RequirementAlreadyVerifiedException

getRequirementVersionCoverages

public Set<RequirementVersionCoverage> getRequirementVersionCoverages()

setRequirementVersionCoverages

public void setRequirementVersionCoverages(Set<RequirementVersionCoverage> requirementVersionCoverages)


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.