| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| IBorrowersService |
|
| 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.Person; | |
| 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 borrowers service specification. | |
| 26 | * | |
| 27 | * @author Baptiste Wicht | |
| 28 | */ | |
| 29 | public interface IBorrowersService extends DataContainer<Person> { | |
| 30 | String DATA_TYPE = "Borrowers"; | |
| 31 | String PERSON_TYPE = "Borrower"; | |
| 32 | ||
| 33 | /** | |
| 34 | * Return an empty borrower. | |
| 35 | * | |
| 36 | * @return An empty borrower. | |
| 37 | */ | |
| 38 | Person getEmptyBorrower(); | |
| 39 | ||
| 40 | /** | |
| 41 | * Delete a borrower. | |
| 42 | * | |
| 43 | * @param borrower The borrower to delete. | |
| 44 | * @return true if the borrower has been deleted else false. | |
| 45 | */ | |
| 46 | boolean delete(Person borrower); | |
| 47 | ||
| 48 | /** | |
| 49 | * Create a borrower. | |
| 50 | * | |
| 51 | * @param borrower The borrower to create. | |
| 52 | */ | |
| 53 | void create(Person borrower); | |
| 54 | ||
| 55 | /** | |
| 56 | * Return the borrowers. | |
| 57 | * | |
| 58 | * @return A List containing all the borrowers. | |
| 59 | */ | |
| 60 | Collection<Person> getBorrowers(); | |
| 61 | ||
| 62 | /** | |
| 63 | * Save the borrower. | |
| 64 | * | |
| 65 | * @param borrower The borrower to save. | |
| 66 | */ | |
| 67 | void save(Person borrower); | |
| 68 | ||
| 69 | /** | |
| 70 | * Indicate if there is no borrowers. | |
| 71 | * | |
| 72 | * @return true if there is no borrowers else false. | |
| 73 | */ | |
| 74 | boolean hasNoBorrowers(); | |
| 75 | ||
| 76 | /** | |
| 77 | * Create all the borrowers. | |
| 78 | * | |
| 79 | * @param borrowers The borrowers to create. | |
| 80 | */ | |
| 81 | void createAll(Iterable<Person> borrowers); | |
| 82 | } |