| 1 | |
package org.jtheque.primary.od.impl; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 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 | |
|
| 28 | |
|
| 29 | |
|
| 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 | |
|
| 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 | |
|
| 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 | |
} |