Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Configuration |
|
| 1.0;1 |
1 | package org.jtheque.films.services.impl.utils.config; | |
2 | ||
3 | /* | |
4 | * This file is part of JTheque. | |
5 | * | |
6 | * JTheque is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License. | |
9 | * | |
10 | * JTheque is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | import org.jtheque.core.managers.state.AbstractState; | |
20 | ||
21 | /** | |
22 | * The application's configuration. | |
23 | * | |
24 | * @author Baptiste Wicht | |
25 | */ | |
26 | 0 | public abstract class Configuration extends AbstractState { |
27 | /** | |
28 | * Indicate if the mail are send automatically. | |
29 | * | |
30 | * @return <code>true</code> if the mails are send automatically | |
31 | */ | |
32 | public final boolean areMailSendAutomatically() { | |
33 | 0 | return Boolean.parseBoolean(getProperty("automaticSend", "false")); |
34 | } | |
35 | ||
36 | /** | |
37 | * Set if the mail are sent automatically or not. | |
38 | * | |
39 | * @param value The new value to set. | |
40 | */ | |
41 | public final void setMailSendAutomatically(boolean value) { | |
42 | 0 | setProperty("automaticSend", Boolean.toString(value)); |
43 | 0 | } |
44 | ||
45 | /** | |
46 | * Return the number of days before send of mail to borrower. | |
47 | * | |
48 | * @return The number of days. | |
49 | */ | |
50 | public final int getTimeBeforeAutomaticSend() { | |
51 | 0 | return Integer.parseInt(getProperty("timeBeforeAutomaticSend", "25")); |
52 | } | |
53 | ||
54 | /** | |
55 | * Set the time before automatic send. | |
56 | * | |
57 | * @param value The new value to set. | |
58 | */ | |
59 | public final void setTimeBeforeAutomaticSend(int value) { | |
60 | 0 | setProperty("timeBeforeAutomaticSend", Integer.toString(value)); |
61 | 0 | } |
62 | ||
63 | /** | |
64 | * Return the automatic mail for the borrower. | |
65 | * | |
66 | * @return The automatic mail. | |
67 | */ | |
68 | public final String getAutomaticMail() { | |
69 | 0 | return getProperty("automaticMail"); |
70 | } | |
71 | ||
72 | /** | |
73 | * Set the automatic mail. This is the mail who's sent to the borrower if there were late. | |
74 | * | |
75 | * @param value The new value. | |
76 | */ | |
77 | public final void setAutomaticMail(String value) { | |
78 | 0 | setProperty("automaticMail", value); |
79 | 0 | } |
80 | ||
81 | /** | |
82 | * Set if we must control or not the lendings at startup. | |
83 | * | |
84 | * @param value <code>true</code> if we must check the lendings at startup. | |
85 | */ | |
86 | public final void setMustControlLendingsOnStartup(boolean value) { | |
87 | 0 | setProperty("controlLendings", Boolean.toString(value)); |
88 | 0 | } |
89 | ||
90 | /** | |
91 | * Indicate if we must control or not the lendings at startup. | |
92 | * | |
93 | * @return <code>true</code> if we must check the lendings at startup. | |
94 | */ | |
95 | public final boolean mustControlLendingsOnStartup() { | |
96 | 0 | return Boolean.valueOf(getProperty("controlLendings", "false")); |
97 | } | |
98 | ||
99 | /** | |
100 | * Set if we alert the user with dialog. | |
101 | * | |
102 | * @param value A boolean value indicated if we alert the user with dialog. | |
103 | */ | |
104 | public final void setAlertWithDialog(boolean value) { | |
105 | 0 | setProperty("alertWithDialog", Boolean.toString(value)); |
106 | 0 | } |
107 | ||
108 | /** | |
109 | * Indicate if we alert the user with dialog. | |
110 | * | |
111 | * @return <code>true</code> if we must avert it else false. | |
112 | */ | |
113 | public final boolean alertWithDialog() { | |
114 | 0 | return Boolean.valueOf(getProperty("alertWithDialog", "false")); |
115 | } | |
116 | ||
117 | /** | |
118 | * Indicate if we alert the user with mail. | |
119 | * | |
120 | * @return <code>true</code> if we must avert it else false. | |
121 | */ | |
122 | public final boolean alertWithMail() { | |
123 | 0 | return Boolean.valueOf(getProperty("alertWithMail", "false")); |
124 | } | |
125 | ||
126 | /** | |
127 | * Set if we must alert the user with mail or not. | |
128 | * | |
129 | * @param value A boolean value indicating if we must avert the user with email. | |
130 | */ | |
131 | public final void setAlertWithMail(boolean value) { | |
132 | 0 | setProperty("alertWithMail", Boolean.toString(value)); |
133 | 0 | } |
134 | ||
135 | /** | |
136 | * Set the maximum of actors to import when me make an automatic add. | |
137 | * | |
138 | * @param value The maximum number of actors. | |
139 | */ | |
140 | public final void setNumberOfActors(int value) { | |
141 | 0 | setProperty("numberOfActors", Integer.toString(value)); |
142 | 0 | } |
143 | ||
144 | /** | |
145 | * Return the maximum numbers of actors to import when me make an automatic add. | |
146 | * | |
147 | * @return The maximum number of actors. | |
148 | */ | |
149 | public final int getNumberOfActors() { | |
150 | 0 | return Integer.valueOf(getProperty("numberOfActors", "10")); |
151 | } | |
152 | } |