View Javadoc

1   /**
2    * 
3    */
4   package sk.stuba.fiit.foo07.genex.beans;
5   
6   import java.sql.Timestamp;
7   
8   /**
9    * @author Martin
10   * 
11   */
12  public class Question implements Comparable<Question> {
13  
14      private String text;
15      private Integer difficulty;
16      private Timestamp created;
17      private Timestamp lastUpdate;
18      private Integer questionID;
19      private Integer userID;
20      private Integer questionTypeID;
21      private Integer derivedFromID;
22  
23      public Question() {
24      }
25  
26      public Question(String text, Integer difficulty, Timestamp created,
27              Timestamp lastUpdate, Integer questionID, Integer userID,
28              Integer questionTypeID, Integer derivedFromID) {
29          super();
30          this.text = text;
31          this.difficulty = difficulty;
32          this.created = created;
33          this.lastUpdate = lastUpdate;
34          this.questionID = questionID;
35          this.userID = userID;
36          this.questionTypeID = questionTypeID;
37          this.derivedFromID = derivedFromID;
38      }
39  
40      /**
41       * @return the text
42       */
43      public String getText() {
44          return text;
45      }
46  
47      /**
48       * @param text
49       *                the text to set
50       */
51      public void setText(String text) {
52          this.text = text;
53      }
54  
55      /**
56       * @return the difficulty
57       */
58      public Integer getDifficulty() {
59          return difficulty;
60      }
61  
62      /**
63       * @param difficulty
64       *                the difficulty to set
65       */
66      public void setDifficulty(Integer difficulty) {
67          this.difficulty = difficulty;
68      }
69  
70      /**
71       * @return the created
72       */
73      public Timestamp getCreated() {
74          return created;
75      }
76  
77      /**
78       * @param created
79       *                the created to set
80       */
81      public void setCreated(Timestamp created) {
82          this.created = created;
83      }
84  
85      /**
86       * @return the lastUpdate
87       */
88      public Timestamp getLastUpdate() {
89          return lastUpdate;
90      }
91  
92      /**
93       * @param lastUpdate
94       *                the lastUpdate to set
95       */
96      public void setLastUpdate(Timestamp lastUpdate) {
97          this.lastUpdate = lastUpdate;
98      }
99  
100     /**
101      * @return the questionID
102      */
103     public Integer getQuestionID() {
104         return questionID;
105     }
106 
107     /**
108      * @param questionID
109      *                the questionID to set
110      */
111     public void setQuestionID(Integer questionID) {
112         this.questionID = questionID;
113     }
114 
115     /**
116      * @return the userID
117      */
118     public Integer getUserID() {
119         return userID;
120     }
121 
122     /**
123      * @param userID
124      *                the userID to set
125      */
126     public void setUserID(Integer userID) {
127         this.userID = userID;
128     }
129 
130     /**
131      * @return the questionTypeID
132      */
133     public Integer getQuestionTypeID() {
134         return questionTypeID;
135     }
136 
137     /**
138      * @param questionTypeID
139      *                the questionTypeID to set
140      */
141     public void setQuestionTypeID(Integer questionTypeID) {
142         this.questionTypeID = questionTypeID;
143     }
144 
145     /**
146      * @return
147      */
148     public Integer getDerivedFromID() {
149         return derivedFromID;
150     }
151 
152     /**
153      * @param derivedFromID
154      *                id of question from which this question is derived
155      */
156     public void setDerivedFromID(Integer derivedFromID) {
157         this.derivedFromID = derivedFromID;
158     }
159 
160     /* (non-Javadoc)
161      * @see java.lang.Object#toString()
162      */
163     @Override
164     public String toString() {
165         return this.text;
166     }
167 
168     /* (non-Javadoc)
169      * @see java.lang.Comparable#compareTo(java.lang.Object)
170      */
171     @Override
172     public int compareTo(Question arg0) {
173         return this.difficulty.compareTo(arg0.difficulty);
174     }
175 
176 }