Skip to content

Commit

Permalink
Add nullability check
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Jan 30, 2024
1 parent 6fc7797 commit 510140a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/opentripplanner/model/plan/LegTimes.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.Duration;
import java.time.ZonedDateTime;
import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

Expand All @@ -10,6 +11,9 @@ public record LegTimes(
@Nullable ZonedDateTime actual,
@Nullable Duration delay
) {
public LegTimes {
Objects.requireNonNull(scheduled);
}
@Nonnull
public static LegTimes of(ZonedDateTime realtime, int delaySecs) {
var delay = Duration.ofSeconds(delaySecs);
Expand Down

0 comments on commit 510140a

Please sign in to comment.