001package org.kuali.ole.sip2.common;
002
003
004/**
005 * This class represents the patron status information that
006 * is received as a part of the SIP2PatronStatusResponse response message.
007 *
008 * @author Gayathri A
009 */
010public class PatronStatus {
011
012    private boolean chargePrivilegesDenied;
013    private boolean renewalPrivilegesDenied;
014    private boolean recallPrivilegesDenied;
015    private boolean holdPrivilegesDenied;
016    private boolean cardReportedLost;
017    private boolean tooManyItemsCharged;
018    private boolean tooManyItemsOverdue;
019    private boolean tooManyRenewals;
020    private boolean tooManyClaimsOfItemsReturned;
021    private boolean tooManyItemsLost;
022    private boolean excessiveOutstandingFines;
023    private boolean excessiveOutstandingFees;
024    private boolean recallOverdue;
025    private boolean tooManyItemsBilled;
026
027    /**
028     * Constructs and initializes a new PatronStatus object with
029     * all the variables set to false.
030     */
031    public PatronStatus() {
032        this.chargePrivilegesDenied = false;
033        this.renewalPrivilegesDenied = false;
034        this.recallPrivilegesDenied = false;
035        this.holdPrivilegesDenied = false;
036        this.cardReportedLost = false;
037        this.tooManyItemsCharged = false;
038        this.tooManyItemsOverdue = false;
039        this.tooManyRenewals = false;
040        this.tooManyClaimsOfItemsReturned = false;
041        this.tooManyItemsLost = false;
042        this.excessiveOutstandingFines = false;
043        this.excessiveOutstandingFees = false;
044        this.recallOverdue = false;
045        this.tooManyItemsBilled = false;
046    }
047
048    /**
049     * Returns true if and only if the patron's charge privileges are
050     * denied.
051     *
052     * @return true if charge privileges are denied, otherwise false
053     */
054    public boolean isChargePrivilegesDenied() {
055        return chargePrivilegesDenied;
056    }
057
058    /**
059     * Sets the value that tells if the patron's charge privileges are denied.
060     *
061     * @param chargePrivilegesDenied true or false
062     */
063    public void setChargePrivilegesDenied(boolean chargePrivilegesDenied) {
064        this.chargePrivilegesDenied = chargePrivilegesDenied;
065    }
066
067    /**
068     * Returns true if and only if the patron's renewal privileges are
069     * denied.
070     *
071     * @return true if renewal privileges are denied, otherwise false
072     */
073    public boolean isRenewalPrivilegesDenied() {
074        return renewalPrivilegesDenied;
075    }
076
077    /**
078     * Sets the value that tells if the patron's renewal privileges are
079     * denied.
080     *
081     * @param renewalPrivilegesDenied true or false
082     */
083    public void setRenewalPrivilegesDenied(boolean renewalPrivilegesDenied) {
084        this.renewalPrivilegesDenied = renewalPrivilegesDenied;
085    }
086
087    /**
088     * Returns true if and only if the patron's recall privileges are
089     * denied.
090     *
091     * @return true if recall privileges are denied, otherwise false
092     */
093    public boolean isRecallPrivilegesDenied() {
094        return recallPrivilegesDenied;
095    }
096
097    /**
098     * Sets the value that tells if the patron's recall privileges are
099     * 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}