| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| PrimarySimpleDataImpl |
|
| 1.4;1.4 |
| 1 | package org.jtheque.primary.od.impl; | |
| 2 | ||
| 3 | import org.jtheque.primary.od.able.PrimarySimpleData; | |
| 4 | import org.jtheque.primary.od.able.SimpleData; | |
| 5 | import org.jtheque.primary.utils.TempUtils; | |
| 6 | ||
| 7 | /* | |
| 8 | * This file is part of JTheque. | |
| 9 | * | |
| 10 | * JTheque is free software: you can redistribute it and/or modify | |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation, either version 3 of the License. | |
| 13 | * | |
| 14 | * JTheque is distributed in the hope that it will be useful, | |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | * GNU General Public License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License | |
| 20 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
| 21 | */ | |
| 22 | ||
| 23 | /** | |
| 24 | * A primary simple data implementation. | |
| 25 | * | |
| 26 | * @author Baptiste Wicht | |
| 27 | */ | |
| 28 | public final class PrimarySimpleDataImpl extends SimpleDataImpl implements PrimarySimpleData { | |
| 29 | private String primaryImpl; | |
| 30 | ||
| 31 | /** | |
| 32 | * Construct a new PrimarySimpleDataImpl. | |
| 33 | * | |
| 34 | * @param type The simple data type. | |
| 35 | * @param primaryImpl The primary implementation. | |
| 36 | */ | |
| 37 | public PrimarySimpleDataImpl(SimpleData.DataType type, String primaryImpl){ | |
| 38 | 0 | super(type); |
| 39 | ||
| 40 | 0 | this.primaryImpl = primaryImpl; |
| 41 | 0 | } |
| 42 | ||
| 43 | @Override | |
| 44 | public String getPrimaryImpl(){ | |
| 45 | 0 | return primaryImpl; |
| 46 | } | |
| 47 | ||
| 48 | @Override | |
| 49 | public void setPrimaryImpl(String impl){ | |
| 50 | 0 | primaryImpl = impl; |
| 51 | 0 | } |
| 52 | ||
| 53 | @Override | |
| 54 | public int hashCode(){ | |
| 55 | 0 | return TempUtils.hashCodeDirect(this, getName(), primaryImpl); |
| 56 | } | |
| 57 | ||
| 58 | @Override | |
| 59 | public boolean equals(Object obj){ | |
| 60 | 0 | if(obj == null){ |
| 61 | 0 | return false; |
| 62 | } | |
| 63 | ||
| 64 | 0 | PrimarySimpleData other = (PrimarySimpleData) obj; |
| 65 | ||
| 66 | 0 | return TempUtils.areEqualsDirect(this, obj, |
| 67 | getName(), primaryImpl, | |
| 68 | other.getName(), other.getPrimaryImpl()); | |
| 69 | } | |
| 70 | } |