VersiĆ³n del proyecto de Apuestas tras la iteraciĆ³n 1
[ISBets21MAUBRY] / eclipse-workspace / ISBets21BRYMAUJONUNA / src / main / java / domain / Question.java
1 package domain;
2
3 import java.io.*;
4
5 import javax.persistence.*;
6 import javax.xml.bind.annotation.XmlAccessType;
7 import javax.xml.bind.annotation.XmlAccessorType;
8 import javax.xml.bind.annotation.XmlIDREF;
9 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
10
11
12 @SuppressWarnings("serial")
13 @XmlAccessorType(XmlAccessType.FIELD)
14 @Entity
15 public class Question implements Serializable {
16         
17         @Id 
18         @XmlJavaTypeAdapter(IntegerAdapter.class)
19         @GeneratedValue
20         private Integer questionNumber;
21         private String question; 
22         private float betMinimum;
23         private String result;  
24         @XmlIDREF
25         private Event event;
26
27         public Question(){
28                 super();
29         }
30         
31         public Question(Integer queryNumber, String query, float betMinimum, Event event) {
32                 super();
33                 this.questionNumber = queryNumber;
34                 this.question = query;
35                 this.betMinimum=betMinimum;
36                 this.event = event;
37         }
38         
39         public Question(String query, float betMinimum,  Event event) {
40                 super();
41                 this.question = query;
42                 this.betMinimum=betMinimum;
43
44                 //this.event = event;
45         }
46
47         /**
48          * Get the  number of the question
49          * 
50          * @return the question number
51          */
52         public Integer getQuestionNumber() {
53                 return questionNumber;
54         }
55
56         /**
57          * Set the bet number to a question
58          * 
59          * @param questionNumber to be setted
60          */
61         public void setQuestionNumber(Integer questionNumber) {
62                 this.questionNumber = questionNumber;
63         }
64
65
66         /**
67          * Get the question description of the bet
68          * 
69          * @return the bet question
70          */
71
72         public String getQuestion() {
73                 return question;
74         }
75
76
77         /**
78          * Set the question description of the bet
79          * 
80          * @param question to be setted
81          */     
82         public void setQuestion(String question) {
83                 this.question = question;
84         }
85
86
87
88         /**
89          * Get the minimun ammount of the bet
90          * 
91          * @return the minimum bet ammount
92          */
93         
94         public float getBetMinimum() {
95                 return betMinimum;
96         }
97
98
99         /**
100          * Get the minimun ammount of the bet
101          * 
102          * @param  betMinimum minimum bet ammount to be setted
103          */
104
105         public void setBetMinimum(float betMinimum) {
106                 this.betMinimum = betMinimum;
107         }
108
109
110
111         /**
112          * Get the result of the  query
113          * 
114          * @return the the query result
115          */
116         public String getResult() {
117                 return result;
118         }
119
120
121
122         /**
123          * Get the result of the  query
124          * 
125          * @param result of the query to be setted
126          */
127         
128         public void setResult(String result) {
129                 this.result = result;
130         }
131
132
133
134         /**
135          * Get the event associated to the bet
136          * 
137          * @return the associated event
138          */
139         public Event getEvent() {
140                 return event;
141         }
142
143
144
145         /**
146          * Set the event associated to the bet
147          * 
148          * @param event to associate to the bet
149          */
150         public void setEvent(Event event) {
151                 this.event = event;
152         }
153
154
155
156
157         public String toString(){
158                 return questionNumber+";"+question+";"+Float.toString(betMinimum);
159         }
160
161
162
163
164         
165 }