hs.hsadmin/hsarback/src/de/hsadmin/mods/pac/ComponentId.java

52 lines
1.1 KiB
Java
Raw Normal View History

2010-10-01 21:52:51 +02:00
package de.hsadmin.mods.pac;
2011-03-22 23:02:06 +01:00
import java.io.Serializable;
2010-10-01 21:52:51 +02:00
2011-03-22 23:02:06 +01:00
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);
}
2010-10-01 21:52:51 +02:00
@Override
public boolean equals(Object obj) {
if (obj != null && obj instanceof ComponentId) {
ComponentId other = (ComponentId) obj;
2011-03-22 23:02:06 +01:00
return getBasePacId() == other.getBasePacId() && getBaseComponentId() == other.getBaseComponentId();
2010-10-01 21:52:51 +02:00
}
return false;
}
@Override
public int hashCode() {
2011-03-22 23:02:06 +01:00
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;
2010-10-01 21:52:51 +02:00
}
}