org.squashtest.csp.tm.domain.requirement
Class Requirement

java.lang.Object
  extended by org.squashtest.csp.tm.domain.requirement.RequirementLibraryNode<RequirementVersion>
      extended by org.squashtest.csp.tm.domain.requirement.Requirement
All Implemented Interfaces:
org.squashtest.csp.core.domain.Identified, AttachmentHolder, LibraryNode, ProjectResource

@Entity
public class Requirement
extends RequirementLibraryNode<RequirementVersion>
implements AttachmentHolder

Entity requirement Note that much of its setters will throw an IllegalRequirementModificationException if a modification is attempted while the status does not allow it.

Author:
bsiri

Constructor Summary
protected Requirement()
           
  Requirement(RequirementVersion version)
          Creates a new requirement which "latest version" is the given RequirementVersion
 
Method Summary
 void accept(RequirementLibraryNodeVisitor visitor)
          Implementors should ask the visitor to visit this object.
 Requirement createPastableCopy()
          Creates a copy usable in a copy / paste operation.
 AttachmentList getAttachmentList()
          Should return the container for this object's attachments.
 RequirementCriticality getCriticality()
           
 String getDescription()
           
 RequirementVersion getLatestVersion()
           
 String getName()
           
 String getReference()
           
 RequirementVersion getResource()
           
 RequirementStatus getStatus()
           
 boolean isLinkable()
           
 boolean isModifiable()
          Tells if this requirement's "intrinsic" properties can be modified.
 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 setStatus(RequirementStatus status)
           
 
Methods inherited from class org.squashtest.csp.tm.domain.requirement.RequirementLibraryNode
getId, getProject, notifyAssociatedWithProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Requirement

protected Requirement()

Requirement

public Requirement(@NotNull
                   RequirementVersion version)
Creates a new requirement which "latest version" is the given RequirementVersion

Parameters:
version -
Method Detail

setName

public void setName(String name)
Specified by:
setName in interface LibraryNode
Parameters:
name - The name of this node. Should not be blank or null.

setDescription

public void setDescription(String description)
Specified by:
setDescription in interface LibraryNode
Parameters:
description - the new node description

accept

public void accept(RequirementLibraryNodeVisitor visitor)
Description copied from class: RequirementLibraryNode
Implementors should ask the visitor to visit this object.

Specified by:
accept in class RequirementLibraryNode<RequirementVersion>

getAttachmentList

public AttachmentList getAttachmentList()
Description copied from interface: AttachmentHolder
Should return the container for this object's attachments. Should never return null.

Specified by:
getAttachmentList in interface AttachmentHolder
Returns:
the AttachmentList of this object.

getReference

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

setReference

public void setReference(String reference)
Set the requirement reference

Parameters:
reference -

createPastableCopy

public Requirement createPastableCopy()
Creates a copy usable in a copy / paste operation. The copy is associated to no version, it should be done by the caller (the latest version might not be eligible for copy / paste).

Specified by:
createPastableCopy in interface LibraryNode
Specified by:
createPastableCopy in class RequirementLibraryNode<RequirementVersion>

getCriticality

public RequirementCriticality getCriticality()
Returns:
the requirement criticality

setCriticality

public void setCriticality(RequirementCriticality criticality)
Set the requirement criticality

Parameters:
criticality -

setStatus

public void setStatus(RequirementStatus 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.

getName

public String getName()
Specified by:
getName in interface LibraryNode
Returns:
Name of this node.

getDescription

public String getDescription()
Specified by:
getDescription in interface LibraryNode

getLatestVersion

public RequirementVersion getLatestVersion()

getResource

public RequirementVersion getResource()
Specified by:
getResource in class RequirementLibraryNode<RequirementVersion>


Copyright © 2010-2012 Squashtest TM, Squashtest.org. All Rights Reserved.