hs.hsadmin/hsarback/src/de/hsadmin/mods/pac/ComponentId.java
2011-03-22 22:02:06 +00:00

52 lines
1.1 KiB
Java

package de.hsadmin.mods.pac;
import java.io.Serializable;
public class ComponentId implements Serializable {
private static final long serialVersionUID = 6213446997257985587L;
private long basePacId;
private long baseComponentId;
public ComponentId() {
}
public ComponentId(long basePacId, long baseComponentId) {
this.setBasePacId(basePacId);
this.setBaseComponentId(baseComponentId);
}
@Override
public boolean equals(Object obj) {
if (obj != null && obj instanceof ComponentId) {
ComponentId other = (ComponentId) obj;
return getBasePacId() == other.getBasePacId() && getBaseComponentId() == other.getBaseComponentId();
}
return false;
}
@Override
public int hashCode() {
return (new Long(getBasePacId() ^ getBaseComponentId() % Integer.MAX_VALUE)).intValue();
}
public void setBasePacId(long basePacId) {
this.basePacId = basePacId;
}
public long getBasePacId() {
return basePacId;
}
public void setBaseComponentId(long baseComponentId) {
this.baseComponentId = baseComponentId;
}
public long getBaseComponentId() {
return baseComponentId;
}
}