package at.demo.optimization.model; import java.io.Serializable; import org.joda.time.Interval; import at.demo.optimization.model.NumericInterval; /** * MediumBooking * * @author demo * */ public class MediumBookingOpt implements Serializable { private static final long serialVersionUID = 5616820300463695243L; private Long meboId; private Long mediId; private NumericInterval indexRange; private Interval timeInterval; private transient boolean moveable = false; public Long getMediId() { return mediId; } public void setMediId(Long mediId) { this.mediId = mediId; } public Long getMeboId() { return meboId; } public void setMeboId(Long meboId) { this.meboId = meboId; } public NumericInterval getIndexRange() { return indexRange; } public void setIndexRange(NumericInterval indexRange) { this.indexRange = indexRange; } public Interval getTimeInterval() { return timeInterval; } public void setTimeInterval(Interval timeInterval) { this.timeInterval = timeInterval; } public boolean getMoveable() { return moveable; } public void setMoveable(boolean moveable) { this.moveable = moveable; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((indexRange == null) ? 0 : indexRange.hashCode()); result = prime * result + ((meboId == null) ? 0 : meboId.hashCode()); result = prime * result + ((mediId == null) ? 0 : mediId.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; MediumBookingOpt other = (MediumBookingOpt) obj; if (meboId == null) { if (other.meboId != null) return false; } else if (!meboId.equals(other.meboId)) return false; if (mediId == null) { if (other.mediId != null) return false; } else if (!mediId.equals(other.mediId)) return false; if (indexRange == null) { if (other.indexRange != null) return false; } else if (!indexRange.equals(other.indexRange)) return false; return true; } public MediumBookingOpt clone() { MediumBookingOpt clone = new MediumBookingOpt(); clone.meboId = meboId; clone.mediId = mediId; clone.meboId = meboId; clone.timeInterval = new Interval(timeInterval.getStart(),timeInterval.getEnd()); clone.indexRange = new NumericInterval(indexRange.getLower(),indexRange.getUpper()); clone.moveable = moveable; return clone; } @Override public String toString() { return "MediumBookingOpt [meboId=" + meboId + "]"; } }