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

54 lines
1.0 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 PacComponentId implements Serializable {
2011-07-07 17:12:56 +02:00
private static final long serialVersionUID = 1L;
2011-03-22 23:02:06 +01:00
2013-04-29 20:01:09 +02:00
private long pac;
private long basePac;
private long baseComponent;
2010-10-01 21:52:51 +02:00
@Override
public boolean equals(Object obj) {
if (obj != null && obj instanceof PacComponentId) {
PacComponentId other = (PacComponentId) obj;
2013-04-29 20:01:09 +02:00
return getPac() == other.getPac() && getBaseComponent() == other.getBaseComponent() && getBasePac() == other.getBasePac();
2010-10-01 21:52:51 +02:00
}
return false;
}
@Override
public int hashCode() {
2013-04-29 20:01:09 +02:00
return (new Long(getPac() ^ getBaseComponent() ^ getBasePac() % Integer.MAX_VALUE)).intValue();
2011-03-22 23:02:06 +01:00
}
2013-04-29 20:01:09 +02:00
public void setPac(long pacId) {
this.pac = pacId;
2011-03-22 23:02:06 +01:00
}
2013-04-29 20:01:09 +02:00
public long getPac() {
return pac;
2011-03-22 23:02:06 +01:00
}
2013-04-29 20:01:09 +02:00
public void setBaseComponent(long baseComponentId) {
this.baseComponent = baseComponentId;
2011-03-22 23:02:06 +01:00
}
2013-04-29 20:01:09 +02:00
public long getBaseComponent() {
return baseComponent;
2011-03-22 23:02:06 +01:00
}
2013-04-29 20:01:09 +02:00
public void setBasePac(long basePacId) {
this.basePac = basePacId;
2011-03-22 23:02:06 +01:00
}
2013-04-29 20:01:09 +02:00
public long getBasePac() {
return basePac;
2010-10-01 21:52:51 +02:00
}
}