View Javadoc
1   package org.kuali.ole.sip2.common;
2   
3   
4   /**
5    * This class represents the patron status information that
6    * is received as a part of the SIP2PatronStatusResponse response message.
7    *
8    * @author Gayathri A
9    */
10  public class PatronStatus {
11  
12      private boolean chargePrivilegesDenied;
13      private boolean renewalPrivilegesDenied;
14      private boolean recallPrivilegesDenied;
15      private boolean holdPrivilegesDenied;
16      private boolean cardReportedLost;
17      private boolean tooManyItemsCharged;
18      private boolean tooManyItemsOverdue;
19      private boolean tooManyRenewals;
20      private boolean tooManyClaimsOfItemsReturned;
21      private boolean tooManyItemsLost;
22      private boolean excessiveOutstandingFines;
23      private boolean excessiveOutstandingFees;
24      private boolean recallOverdue;
25      private boolean tooManyItemsBilled;
26  
27      /**
28       * Constructs and initializes a new PatronStatus object with
29       * all the variables set to false.
30       */
31      public PatronStatus() {
32          this.chargePrivilegesDenied = false;
33          this.renewalPrivilegesDenied = false;
34          this.recallPrivilegesDenied = false;
35          this.holdPrivilegesDenied = false;
36          this.cardReportedLost = false;
37          this.tooManyItemsCharged = false;
38          this.tooManyItemsOverdue = false;
39          this.tooManyRenewals = false;
40          this.tooManyClaimsOfItemsReturned = false;
41          this.tooManyItemsLost = false;
42          this.excessiveOutstandingFines = false;
43          this.excessiveOutstandingFees = false;
44          this.recallOverdue = false;
45          this.tooManyItemsBilled = false;
46      }
47  
48      /**
49       * Returns true if and only if the patron's charge privileges are
50       * denied.
51       *
52       * @return true if charge privileges are denied, otherwise false
53       */
54      public boolean isChargePrivilegesDenied() {
55          return chargePrivilegesDenied;
56      }
57  
58      /**
59       * Sets the value that tells if the patron's charge privileges are denied.
60       *
61       * @param chargePrivilegesDenied true or false
62       */
63      public void setChargePrivilegesDenied(boolean chargePrivilegesDenied) {
64          this.chargePrivilegesDenied = chargePrivilegesDenied;
65      }
66  
67      /**
68       * Returns true if and only if the patron's renewal privileges are
69       * denied.
70       *
71       * @return true if renewal privileges are denied, otherwise false
72       */
73      public boolean isRenewalPrivilegesDenied() {
74          return renewalPrivilegesDenied;
75      }
76  
77      /**
78       * Sets the value that tells if the patron's renewal privileges are
79       * denied.
80       *
81       * @param renewalPrivilegesDenied true or false
82       */
83      public void setRenewalPrivilegesDenied(boolean renewalPrivilegesDenied) {
84          this.renewalPrivilegesDenied = renewalPrivilegesDenied;
85      }
86  
87      /**
88       * Returns true if and only if the patron's recall privileges are
89       * denied.
90       *
91       * @return true if recall privileges are denied, otherwise false
92       */
93      public boolean isRecallPrivilegesDenied() {
94          return recallPrivilegesDenied;
95      }
96  
97      /**
98       * Sets the value that tells if the patron's recall privileges are
99       * denied.
100      *
101      * @param recallPrivilegesDenied true or false
102      */
103     public void setRecallPrivilegesDenied(boolean recallPrivilegesDenied) {
104         this.recallPrivilegesDenied = recallPrivilegesDenied;
105     }
106 
107     /**
108      * Returns true if and only if the patron's hold privileges are
109      * denied.
110      *
111      * @return true if hold privileges are denied, otherwise false
112      */
113     public boolean isHoldPrivilegesDenied() {
114         return holdPrivilegesDenied;
115     }
116 
117     /**
118      * Sets the value that tells if the patron's hold privileges are
119      * denied.
120      *
121      * @param holdPrivilegesDenied true or false
122      */
123     public void setHoldPrivilegesDenied(boolean holdPrivilegesDenied) {
124         this.holdPrivilegesDenied = holdPrivilegesDenied;
125     }
126 
127     /**
128      * Returns true if and only if the patron's card is reported lost.
129      *
130      * @return true if card is reported lost, otherwise false
131      */
132     public boolean isCardReportedLost() {
133         return cardReportedLost;
134     }
135 
136     /**
137      * Sets the value that tells if the patron's card is reported lost.
138      *
139      * @param cardReportedLost true or false
140      */
141     public void setCardReportedLost(boolean cardReportedLost) {
142         this.cardReportedLost = cardReportedLost;
143     }
144 
145     /**
146      * Returns true if and only if the patron has too many items charged.
147      *
148      * @return true if patron has too many items charged, otherwise false
149      */
150     public boolean isTooManyItemsCharged() {
151         return tooManyItemsCharged;
152     }
153 
154     /**
155      * Sets the value that tells if the patron has too many items charged.
156      *
157      * @param tooManyItemsCharged true or false
158      */
159     public void setTooManyItemsCharged(boolean tooManyItemsCharged) {
160         this.tooManyItemsCharged = tooManyItemsCharged;
161     }
162 
163     /**
164      * Returns true if and only if the patron has too many overdue items.
165      *
166      * @return true if patron has too many overdue items, otherwise false
167      */
168     public boolean isTooManyItemsOverdue() {
169         return tooManyItemsOverdue;
170     }
171 
172     /**
173      * Sets the value that tells if the patron has too many overdue items.
174      *
175      * @param tooManyItemsOverdue true or false
176      */
177     public void setTooManyItemsOverdue(boolean tooManyItemsOverdue) {
178         this.tooManyItemsOverdue = tooManyItemsOverdue;
179     }
180 
181     /**
182      * Returns true if and only if the patron has too many renewals.
183      *
184      * @return true if patron has too many renewals, otherwise false
185      */
186     public boolean isTooManyRenewals() {
187         return tooManyRenewals;
188     }
189 
190     /**
191      * Sets the value that tells if the patron has too many renewals.
192      *
193      * @param tooManyRenewals true or false
194      */
195     public void setTooManyRenewals(boolean tooManyRenewals) {
196         this.tooManyRenewals = tooManyRenewals;
197     }
198 
199     /**
200      * Returns true if and only if the patron has too many claims
201      * of items returned.
202      *
203      * @return true if patron has too many claims of items returned,
204      * otherwise false
205      */
206     public boolean isTooManyClaimsOfItemsReturned() {
207         return tooManyClaimsOfItemsReturned;
208     }
209 
210     /**
211      * Sets the value that tells if the patron has too many claims
212      * of items returned.
213      *
214      * @param tooManyClaimsOfItemsReturned true or false
215      */
216     public void setTooManyClaimsOfItemsReturned(boolean tooManyClaimsOfItemsReturned) {
217         this.tooManyClaimsOfItemsReturned = tooManyClaimsOfItemsReturned;
218     }
219 
220     /**
221      * Returns true if and only if the patron has too many lost items.
222      *
223      * @return true if patron has too many lost items, otherwise false
224      */
225     public boolean isTooManyItemsLost() {
226         return tooManyItemsLost;
227     }
228 
229     /**
230      * Sets the value that tells if the patron has too many lost items.
231      *
232      * @param tooManyItemsLost true or false
233      */
234     public void setTooManyItemsLost(boolean tooManyItemsLost) {
235         this.tooManyItemsLost = tooManyItemsLost;
236     }
237 
238     /**
239      * Returns true if and only if the patron has excessive outstanding fines.
240      *
241      * @return true if patron has excessive outstanding fines, otherwise false
242      */
243     public boolean isExcessiveOutstandingFines() {
244         return excessiveOutstandingFines;
245     }
246 
247     /**
248      * Sets the value that tells if the patron has excessive outstanding fines.
249      *
250      * @param excessiveOutstandingFines true or false
251      */
252     public void setExcessiveOutstandingFines(boolean excessiveOutstandingFines) {
253         this.excessiveOutstandingFines = excessiveOutstandingFines;
254     }
255 
256     /**
257      * Returns true if and only if the patron has excessive outstanding fees.
258      *
259      * @return true if patron has excessive outstanding fees, otherwise false
260      */
261     public boolean isExcessiveOutstandingFees() {
262         return excessiveOutstandingFees;
263     }
264 
265     /**
266      * Sets the value that tells if the patron has excessive outstanding fees.
267      *
268      * @param excessiveOutstandingFees true or false
269      */
270     public void setExcessiveOutstandingFees(boolean excessiveOutstandingFees) {
271         this.excessiveOutstandingFees = excessiveOutstandingFees;
272     }
273 
274     /**
275      * Returns true if and only if the patron has overdue recall.
276      *
277      * @return true if patron has overdue recall, otherwise false
278      */
279     public boolean isRecallOverdue() {
280         return recallOverdue;
281     }
282 
283     /**
284      * Sets the value that tells if the patron has overdue recall.
285      *
286      * @param recallOverdue true or false
287      */
288     public void setRecallOverdue(boolean recallOverdue) {
289         this.recallOverdue = recallOverdue;
290     }
291 
292     /**
293      * Returns true if and only if the patron has too many billed items.
294      *
295      * @return true if patron has too many billed items, otherwise false
296      */
297     public boolean isTooManyItemsBilled() {
298         return tooManyItemsBilled;
299     }
300 
301     /**
302      * Sets the value that tells if the patron has too many billed items.
303      *
304      * @param tooManyItemsBilled true or false
305      */
306     public void setTooManyItemsBilled(boolean tooManyItemsBilled) {
307         this.tooManyItemsBilled = tooManyItemsBilled;
308     }
309 
310     /**
311      * Returns a String presentation of this PatronStatus object.
312      *
313      * @return string presentation of this object
314      */
315     @Override
316     public String toString() {
317         StringBuilder builder = new StringBuilder();
318         builder.append(OLESIP2Util.bool2CharEmpty(chargePrivilegesDenied));
319         builder.append(OLESIP2Util.bool2CharEmpty(renewalPrivilegesDenied));
320         builder.append(OLESIP2Util.bool2CharEmpty(recallPrivilegesDenied));
321         builder.append(OLESIP2Util.bool2CharEmpty(holdPrivilegesDenied));
322         builder.append(OLESIP2Util.bool2CharEmpty(cardReportedLost));
323         builder.append(OLESIP2Util.bool2CharEmpty(tooManyItemsCharged));
324         builder.append(OLESIP2Util.bool2CharEmpty(tooManyItemsOverdue));
325         builder.append(OLESIP2Util.bool2CharEmpty(tooManyRenewals));
326         builder.append(OLESIP2Util.bool2CharEmpty(tooManyClaimsOfItemsReturned));
327         builder.append(OLESIP2Util.bool2CharEmpty(tooManyItemsLost));
328         builder.append(OLESIP2Util.bool2CharEmpty(excessiveOutstandingFines));
329         builder.append(OLESIP2Util.bool2CharEmpty(excessiveOutstandingFees));
330         builder.append(OLESIP2Util.bool2CharEmpty(recallOverdue));
331         builder.append(OLESIP2Util.bool2CharEmpty(tooManyItemsBilled));
332         return builder.toString();
333     }
334 }