Skip to content

Commit 5554ff2

Browse files
committed
Updated Route with a precondition for number of Stops.
1 parent dd7d2ef commit 5554ff2

File tree

1 file changed

+9
-1
lines changed
  • src/main/java/edu/umn/msse/busbuddy/transit

1 file changed

+9
-1
lines changed

src/main/java/edu/umn/msse/busbuddy/transit/Route.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class Route {
4646
/**
4747
* Instantiates a new Route with all required fields.
4848
*
49-
* @pre \paramname{stops}.size() > 0
49+
* @pre \paramname{stops}.size() >= 2
5050
*
5151
* @param routeId The Route id
5252
* @param routeName The Route name
@@ -63,6 +63,14 @@ public List<Stop> getStops() {
6363
return stops;
6464
}
6565

66+
67+
/**
68+
* Sets the {@link Stop}s of this Route.
69+
*
70+
* Note that there must be 2 or more {@link Stop}s in a Route.
71+
*
72+
* @pre \paramname{stops}.size() >= 2
73+
*/
6674
public void setStops(List<Stop> stops) {
6775
this.stops = stops;
6876
}

0 commit comments

Comments
 (0)