View Javadoc

1   /***
2    * 
3    */
4   package org.telscenter.pas.steps.domain;
5   
6   import java.util.ArrayList;
7   import java.util.HashMap;
8   import java.util.List;
9   import java.util.Map;
10  
11  /***
12   * @author anthonyperritano
13   */
14  public class AssessmentItem {
15  
16  	private String identifier;
17  
18  	private ItemBody itemBody = new ItemBody();
19  
20  	private String label;
21  
22  	// key: feedbackIdentifier; value: FeedbackModal
23  	private Map<String, FeedbackModal> modalFeedbacks = new HashMap<String, FeedbackModal>();
24  
25  	private List<ResponseDeclaration> responseDeclarations = new ArrayList<ResponseDeclaration>();
26  
27  	public AssessmentItem() {
28  		super();
29  	}
30  
31  	/***
32  	 * @param string
33  	 */
34  	public AssessmentItem(String identifier) {
35  		this.identifier = identifier;
36  	}
37  
38  	public void addResponseDeclaration(ResponseDeclaration responseDeclaration) {
39  		responseDeclarations.add(responseDeclaration);
40  	}
41  
42  	public String getIdentifier() {
43  		return identifier;
44  	}
45  
46  	public ItemBody getItemBody() {
47  		return itemBody;
48  	}
49  
50  	public String getLabel() {
51  		return label;
52  	}
53  
54  	/***
55  	 * @return the modalFeedbacks
56  	 */
57  	public Map<String, FeedbackModal> getModalFeedbacks() {
58  		return modalFeedbacks;
59  	}
60  
61  	public List<ResponseDeclaration> getResponseDeclarations() {
62  		return responseDeclarations;
63  	}
64  
65  	public void setIdentifier(String identifier) {
66  		this.identifier = identifier;
67  	}
68  
69  	public void setItemBody(ItemBody itemBody) {
70  		this.itemBody = itemBody;
71  	}
72  
73  	public void setLabel(String label) {
74  		this.label = label;
75  	}
76  
77  	/***
78  	 * @param modalFeedbacks
79  	 *            the modalFeedbacks to set
80  	 */
81  	public void setModalFeedbacks(Map<String, FeedbackModal> modalFeedbacks) {
82  		this.modalFeedbacks = modalFeedbacks;
83  	}
84  
85  	public void setResponseDeclarations(
86  			List<ResponseDeclaration> responseDeclarations) {
87  		if (responseDeclarations == null)
88  			throw new NullPointerException(
89  					"responseDeclarations property cannot be null");
90  		this.responseDeclarations = responseDeclarations;
91  	}
92  
93  	public String toString() {
94  		return "There are " + this.itemBody.getInteractions().size()
95  				+ " interactions";
96  	}
97  
98  }