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