| 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.Collection; |
| 20 | |
import org.jtheque.primary.od.impl.abstraction.AbstractPrimaryData; |
| 21 | |
import org.jtheque.primary.utils.TempUtils; |
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | 0 | public final class CollectionImpl extends AbstractPrimaryData implements Collection { |
| 29 | |
private String title; |
| 30 | |
private boolean protection; |
| 31 | |
private String password; |
| 32 | |
|
| 33 | |
|
| 34 | |
|
| 35 | |
@Override |
| 36 | |
public void setTitle(String title){ |
| 37 | 0 | this.title = title; |
| 38 | 0 | } |
| 39 | |
|
| 40 | |
@Override |
| 41 | |
public String getTitle(){ |
| 42 | 0 | return title; |
| 43 | |
} |
| 44 | |
|
| 45 | |
@Override |
| 46 | |
public boolean isProtection(){ |
| 47 | 0 | return protection; |
| 48 | |
} |
| 49 | |
|
| 50 | |
@Override |
| 51 | |
public void setProtection(boolean protection){ |
| 52 | 0 | this.protection = protection; |
| 53 | 0 | } |
| 54 | |
|
| 55 | |
@Override |
| 56 | |
public String getPassword(){ |
| 57 | 0 | return password; |
| 58 | |
} |
| 59 | |
|
| 60 | |
@Override |
| 61 | |
public void setPassword(String password){ |
| 62 | 0 | this.password = password; |
| 63 | 0 | } |
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
@Override |
| 68 | |
public String getDisplayableText(){ |
| 69 | 0 | return title; |
| 70 | |
} |
| 71 | |
|
| 72 | |
@Override |
| 73 | |
public String toString(){ |
| 74 | 0 | return title; |
| 75 | |
} |
| 76 | |
|
| 77 | |
@Override |
| 78 | |
public int hashCode(){ |
| 79 | 0 | return TempUtils.hashCodeDirect(title, protection, password); |
| 80 | |
} |
| 81 | |
|
| 82 | |
@Override |
| 83 | |
public boolean equals(Object obj){ |
| 84 | 0 | if(obj == null){ |
| 85 | 0 | return false; |
| 86 | |
} |
| 87 | |
|
| 88 | 0 | Collection other = (Collection) obj; |
| 89 | |
|
| 90 | 0 | return TempUtils.areEqualsDirect(this, obj, |
| 91 | |
getId(), title, protection, password, |
| 92 | |
other.getId(), other.getTitle(), other.isProtection(), other.getPassword()); |
| 93 | |
} |
| 94 | |
} |