Coverage Report - org.jtheque.primary.od.impl.LendingImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
LendingImpl
0 %
0/18
0 %
0/2
1.2
 
 1  
 package org.jtheque.primary.od.impl;
 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.primary.od.able.Lending;
 20  
 import org.jtheque.primary.od.able.Person;
 21  
 import org.jtheque.primary.od.impl.abstraction.AbstractPrimaryData;
 22  
 import org.jtheque.primary.od.impl.temp.LendingTemporaryContext;
 23  
 import org.jtheque.primary.utils.TempUtils;
 24  
 import org.jtheque.utils.bean.IntDate;
 25  
 
 26  
 /**
 27  
  * A lending.
 28  
  *
 29  
  * @author Baptiste Wicht
 30  
  */
 31  0
 public final class LendingImpl extends AbstractPrimaryData implements Lending {
 32  
         private IntDate date;
 33  
         private Person thePerson;
 34  
         private int theOther;
 35  
 
 36  0
         private final LendingTemporaryContext temporaryContext = new LendingTemporaryContext();
 37  
 
 38  
         //Data methods
 39  
 
 40  
         @Override
 41  
         public void setDate(IntDate date){
 42  0
                 this.date = date;
 43  0
         }
 44  
 
 45  
         @Override
 46  
         public IntDate getDate(){
 47  0
                 return date;
 48  
         }
 49  
 
 50  
         @Override
 51  
         public void setThePerson(Person thePerson){
 52  0
                 this.thePerson = thePerson;
 53  0
         }
 54  
 
 55  
         @Override
 56  
         public Person getThePerson(){
 57  0
                 return thePerson;
 58  
         }
 59  
 
 60  
         @Override
 61  
         public void setTheOther(int other){
 62  0
                 theOther = other;
 63  0
         }
 64  
 
 65  
         @Override
 66  
         public int getTheOther(){
 67  0
                 return theOther;
 68  
         }
 69  
 
 70  
         //Utility methods
 71  
 
 72  
         @Override
 73  
         public LendingTemporaryContext getTemporaryContext(){
 74  0
                 return temporaryContext;
 75  
         }
 76  
 
 77  
         @Override
 78  
         public String getDisplayableText(){
 79  0
                 return "Lending of :  " + theOther;
 80  
         }
 81  
 
 82  
         @Override
 83  
         public int hashCode(){
 84  0
                 return TempUtils.hashCodeDirect(getId(), date, thePerson, getPrimaryImpl(), theOther);
 85  
         }
 86  
 
 87  
         @Override
 88  
         public boolean equals(Object obj){
 89  0
         if(obj == null){
 90  0
             return false;
 91  
         }
 92  
 
 93  0
                 Lending other = (Lending) obj;
 94  
 
 95  0
                 return TempUtils.areEqualsDirect(
 96  
                                 this, obj,
 97  
                                 getId(), date, theOther, getPrimaryImpl(),
 98  
                                 other.getId(), other.getDate(), other.getTheOther(), other.getPrimaryImpl());
 99  
         }
 100  
 }