Coverage Report - org.jtheque.primary.services.able.ILendingsService
 
Classes in this File Line Coverage Branch Coverage Complexity
ILendingsService
N/A
N/A
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.Lending;
 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 lendings service specification.
 26  
  *
 27  
  * @author Baptiste Wicht
 28  
  */
 29  
 public interface ILendingsService extends DataContainer<Lending>, DataService<Lending> {
 30  
         String DATA_TYPE = "Lendings";
 31  
 
 32  
         /**
 33  
          * Return the lending with this id.
 34  
          *
 35  
          * @param id The id to search the kind with.
 36  
          *
 37  
          * @return The lending.
 38  
          */
 39  
         Lending getLending(int id);
 40  
 
 41  
         /**
 42  
          * Indicate if there is no lendings.
 43  
          *
 44  
          * @return true if there is no lendings else false.
 45  
          */
 46  
         boolean hasNoLendings();
 47  
 
 48  
         /**
 49  
          * Return all the lendings.
 50  
          *
 51  
          * @return A List containing all the lendings.
 52  
          */
 53  
         Collection<Lending> getLendings();
 54  
 
 55  
         /**
 56  
          * Test if the lending is late or not.
 57  
          *
 58  
          * @param lending The lendings to test.
 59  
          * @param days The days limit for lendings.
 60  
          *
 61  
          * @return <code>true</code> if the lending is late else <code>false</code>.
 62  
          */
 63  
         boolean isLate(Lending lending, int days);
 64  
 
 65  
         /**
 66  
          * Return an empty lending.
 67  
          *
 68  
          * @return An empty lending.
 69  
          */
 70  
         Lending getEmptyLending();
 71  
 }