added protest start time to status panel; fixed date display; added assertions about non-nullness of protest time range and its bounds

Change-Id: I8697c5083fa7e5b5f3cfd0092256cbd9a67d049a
This commit is contained in:
Axel Uhl committed 2016-11-29 17:41:13 +01:00
1 parent c3f18e7451
commit e691bca866
9 files changed
+35 -16

No files matched your search

@@ -9,7 +9,9 @@ import com.sap.sse.common.TimeRange;
public interface RaceLogProtestStartTimeEvent extends RaceLogEvent {
/**
* Returns the time range of the race's protest time.
* Returns the time range of the race's protest time. The result is never {@code null}
* and the {@link TimeRange} returned always has a valid {@link TimeRange#from() start}
* and {@link TimeRange#to() end}.
*/
TimeRange getProtestTime();
}
@@ -16,6 +16,7 @@ public class RaceLogProtestStartTimeEventImpl extends RaceLogEventImpl implement
public RaceLogProtestStartTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
Serializable pId, int pPassId, TimeRange protestTime) {
super(createdAt, pTimePoint, author, pId, pPassId);
assert protestTime != null && protestTime.from() != null && protestTime.to() != null;
this.protestTime = protestTime;
}
@@ -171,6 +171,7 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
@Override
public void setProtestTime(TimePoint now, TimeRange protestTime) {
assert protestTime != null && protestTime.from() != null && protestTime.to() != null;
raceLog.add(new RaceLogProtestStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), protestTime));
}