Skip to content

Commit

Permalink
Merge pull request #6143 from Skanetrafiken/transit-model-operators
Browse files Browse the repository at this point in the history
Minor cleanup of operator stuff in TransitModel
  • Loading branch information
habrahamsson-skanetrafiken authored Oct 11, 2024
2 parents dc776d6 + 014824b commit 151c870
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/opentripplanner/netex/NetexModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void buildGraph() {
// TODO OTP2 - Move this into the AddTransitModelEntitiesToGraph
// - and make sure they also work with GTFS feeds - GTFS do no
// - have operators and notice assignments.
transitModel.getOperators().addAll(otpService.getAllOperators());
transitModel.addOperators(otpService.getAllOperators());
transitModel.addNoticeAssignments(otpService.getNoticeAssignments());

AddTransitModelEntitiesToGraph.addToGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ public void addFeedInfo(FeedInfo info) {
this.transitModel.addFeedInfo(info);
}

@Override
public Collection<Operator> getOperators() {
return this.transitModel.getOperators();
}

@Override
public Collection<Notice> getNoticesByEntity(AbstractTransitEntity<?, ?> entity) {
return this.transitModel.getNoticesByElement().get(entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@ public Set<ZoneId> getAgencyTimeZones() {
}

public Collection<Operator> getOperators() {
return operators;
return Collections.unmodifiableCollection(operators);
}

public void addOperators(Collection<Operator> operators) {
this.operators.addAll(operators);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ public interface TransitService {

FeedInfo getFeedInfo(String feedId);

Collection<Operator> getOperators();

Collection<Notice> getNoticesByEntity(AbstractTransitEntity<?, ?> entity);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private Trip createTrip(TripInput tripInput) {
transitModel.addTripOnServiceDate(tripOnServiceDate);

if (tripInput.route().getOperator() != null) {
transitModel.getOperators().add(tripInput.route().getOperator());
transitModel.addOperators(List.of(tripInput.route().getOperator()));
}

var stopTimes = IntStream
Expand Down

0 comments on commit 151c870

Please sign in to comment.