package com.mindskip.xzs.queue; import lombok.Getter; import lombok.Setter; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; /** * @author gonghl */ @Getter @Setter public class ExamPaperTimeTask implements Delayed { private long examPaperId; private long expiry; @Override public long getDelay(TimeUnit unit) { return unit.convert(expiry - System.currentTimeMillis(), TimeUnit.MILLISECONDS); } @Override public int compareTo(Delayed o) { return Long.compare(expiry, ((ExamPaperTimeTask) o).expiry); } }