
org.opentripplanner.ext.geocoder.configure.GeocoderModule 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
The newest version!
package org.opentripplanner.ext.geocoder.configure;
import dagger.Module;
import dagger.Provides;
import jakarta.inject.Singleton;
import javax.annotation.Nullable;
import org.opentripplanner.ext.geocoder.LuceneIndex;
import org.opentripplanner.ext.stopconsolidation.StopConsolidationService;
import org.opentripplanner.framework.application.OTPFeature;
import org.opentripplanner.transit.service.TransitModel;
/**
* This module builds the Lucene geocoder based on whether the feature flag is on or off.
*/
@Module
public class GeocoderModule {
@Provides
@Singleton
@Nullable
LuceneIndex luceneIndex(
TransitModel transitModel,
@Nullable StopConsolidationService stopConsolidationService
) {
if (OTPFeature.SandboxAPIGeocoder.isOn()) {
return new LuceneIndex(transitModel, stopConsolidationService);
} else {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy