Coverage Report - org.jtheque.primary.services.able.DataService
 
Classes in this File Line Coverage Branch Coverage Complexity
DataService
N/A
N/A
1
 
 1  
 package org.jtheque.primary.services.able;
 2  
 
 3  
 import org.jtheque.core.managers.persistence.able.Entity;
 4  
 
 5  
 /*
 6  
  * This file is part of JTheque.
 7  
  *
 8  
  * JTheque is free software: you can redistribute it and/or modify
 9  
  * it under the terms of the GNU General Public License as published by
 10  
  * the Free Software Foundation, either version 3 of the License.
 11  
  *
 12  
  * JTheque is distributed in the hope that it will be useful,
 13  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 15  
  * GNU General Public License for more details.
 16  
  *
 17  
  * You should have received a copy of the GNU General Public License
 18  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 19  
  */
 20  
 
 21  
 /**
 22  
  * A data service specification.
 23  
  *
 24  
  * @author Baptiste Wicht
 25  
  * @param <T> The type of entity of this service.
 26  
  */
 27  
 public interface DataService<T extends Entity> {
 28  
         /**
 29  
          * Delete the data.
 30  
          *
 31  
          * @param data The data to delete.
 32  
          *
 33  
          * @return true if the data has been deleted else false.
 34  
          */
 35  
         boolean delete(T data);
 36  
 
 37  
         /**
 38  
          * Save the data.
 39  
          *
 40  
          * @param data The data to save.
 41  
          */
 42  
         void save(T data);
 43  
 
 44  
         /**
 45  
          * Create the data.
 46  
          *
 47  
          * @param data The data to create.
 48  
          */
 49  
         void create(T data);
 50  
 }