Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ILanguagesService |
|
| 1.0;1 |
1 | package org.jtheque.primary.services.able; | |
2 | ||
3 | import org.jtheque.core.managers.persistence.able.DataContainer; | |
4 | import org.jtheque.primary.od.able.Language; | |
5 | ||
6 | import java.util.Collection; | |
7 | ||
8 | /* | |
9 | * This file is part of JTheque. | |
10 | * | |
11 | * JTheque is free software: you can redistribute it and/or modify | |
12 | * it under the terms of the GNU General Public License as published by | |
13 | * the Free Software Foundation, either version 3 of the License. | |
14 | * | |
15 | * JTheque is distributed in the hope that it will be useful, | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | * GNU General Public License for more details. | |
19 | * | |
20 | * You should have received a copy of the GNU General Public License | |
21 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
22 | */ | |
23 | ||
24 | /** | |
25 | * A languages service specification. | |
26 | * | |
27 | * @author Baptiste Wicht | |
28 | */ | |
29 | public interface ILanguagesService extends DataContainer<Language> { | |
30 | String DATA_TYPE = "Languages"; | |
31 | ||
32 | /** | |
33 | * Return the default language. | |
34 | * | |
35 | * @return The default language. | |
36 | */ | |
37 | Language getDefaultLanguage(); | |
38 | ||
39 | /** | |
40 | * Create the language. | |
41 | * | |
42 | * @param language The language to create. | |
43 | */ | |
44 | void create(Language language); | |
45 | ||
46 | /** | |
47 | * Delete the language. | |
48 | * | |
49 | * @param language The language to delete. | |
50 | * @return true if the language has been deleted. | |
51 | */ | |
52 | boolean delete(Language language); | |
53 | ||
54 | /** | |
55 | * Save the language. | |
56 | * | |
57 | * @param language The language. | |
58 | */ | |
59 | void save(Language language); | |
60 | ||
61 | /** | |
62 | * Return the language. | |
63 | * | |
64 | * @param name The name of the language. | |
65 | * @return The searched language. | |
66 | */ | |
67 | Language getLanguage(String name); | |
68 | ||
69 | /** | |
70 | * Indicate if the language exist. | |
71 | * | |
72 | * @param language The language to test if exist. | |
73 | * @return true if the language exist else false. | |
74 | */ | |
75 | boolean exist(Language language); | |
76 | ||
77 | /** | |
78 | * Create all the languages. | |
79 | * | |
80 | * @param languages The languages to create. | |
81 | */ | |
82 | void createAll(Iterable<Language> languages); | |
83 | ||
84 | /** | |
85 | * Return all the languages. | |
86 | * | |
87 | * @return A List containing all the languages. | |
88 | */ | |
89 | Collection<Language> getLanguages(); | |
90 | ||
91 | /** | |
92 | * Return an empty <code>Language</code>. | |
93 | * | |
94 | * @return An empty language. | |
95 | */ | |
96 | Language getEmptyLanguage(); | |
97 | } |