| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| IPersonService |
|
| 1.0;1 |
| 1 | package org.jtheque.primary.services.able; | |
| 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.persistence.able.DataContainer; | |
| 20 | import org.jtheque.primary.od.able.Person; | |
| 21 | ||
| 22 | import java.util.Collection; | |
| 23 | ||
| 24 | /** | |
| 25 | * A service for the person functions. | |
| 26 | * | |
| 27 | * @author Baptiste Wicht | |
| 28 | */ | |
| 29 | public interface IPersonService extends DataContainer<Person>, DataService<Person> { | |
| 30 | /** | |
| 31 | * Return an empty person. | |
| 32 | * | |
| 33 | * @return An empty person. | |
| 34 | */ | |
| 35 | Person getDefaultPerson(); | |
| 36 | ||
| 37 | /** | |
| 38 | * Indicate if the service has nos persons. | |
| 39 | * | |
| 40 | * @return true if there is no persons else false. | |
| 41 | */ | |
| 42 | boolean hasNoPerson(); | |
| 43 | ||
| 44 | /** | |
| 45 | * Return all the persons. | |
| 46 | * | |
| 47 | * @return A List containing all the persons. | |
| 48 | */ | |
| 49 | Collection<Person> getPersons(); | |
| 50 | ||
| 51 | /** | |
| 52 | * Indicate if an person exists or not. | |
| 53 | * | |
| 54 | * @param person The person to test. | |
| 55 | * | |
| 56 | * @return true if the person exists else false. | |
| 57 | */ | |
| 58 | boolean exist(Person person); | |
| 59 | ||
| 60 | /** | |
| 61 | * Return the actor denoted by this first name and name. | |
| 62 | * | |
| 63 | * @param firstName The first name of the person. | |
| 64 | * @param name The name of the person. | |
| 65 | * | |
| 66 | * @return The person. | |
| 67 | */ | |
| 68 | Person getPerson(String firstName, String name); | |
| 69 | ||
| 70 | /** | |
| 71 | * Indicate if a person with this first name and name exist or not. | |
| 72 | * | |
| 73 | * @param firstName The first name of the person. | |
| 74 | * @param name The name of the person. | |
| 75 | * | |
| 76 | * @return true if the person exists else false. | |
| 77 | */ | |
| 78 | boolean exist(String firstName, String name); | |
| 79 | ||
| 80 | /** | |
| 81 | * Return an empty person. | |
| 82 | * | |
| 83 | * @return An empty person. | |
| 84 | */ | |
| 85 | Person getEmptyPerson(); | |
| 86 | ||
| 87 | /** | |
| 88 | * Create all the persons. | |
| 89 | * | |
| 90 | * @param persons The persons to create. | |
| 91 | */ | |
| 92 | void createAll(Iterable<Person> persons); | |
| 93 | ||
| 94 | /** | |
| 95 | * Return the type of person managed by this service. | |
| 96 | * | |
| 97 | * @return The person type. | |
| 98 | */ | |
| 99 | String getPersonType(); | |
| 100 | } |