org.opentripplanner.netex.validation.JourneyPatternNotFoundInSJ Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.netex.validation;
import org.opentripplanner.graph_builder.DataImportIssue;
import org.opentripplanner.netex.issues.ObjectNotFound;
import org.rutebanken.netex.model.ServiceJourney;
class JourneyPatternNotFoundInSJ extends AbstractHMapValidationRule {
@Override
public Status validate(ServiceJourney sj) {
return index.getJourneyPatternsById().lookup(getPatternId(sj)) == null
? Status.DISCARD
: Status.OK;
}
@Override
public DataImportIssue logMessage(String key, ServiceJourney sj) {
return new ObjectNotFound("ServiceJourney", sj.getId(), "JourneyPattern", getPatternId(sj));
}
private String getPatternId(ServiceJourney sj) {
return sj.getJourneyPatternRef().getValue().getRef();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy