mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-08 15:48:48 +00:00
NetworkProvider: Add types parameter to suggestLocations().
This commit is contained in:
parent
0ea83a1ad3
commit
8e52035ce5
11 changed files with 70 additions and 57 deletions
|
@ -241,10 +241,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
url.addEncodedQueryParameter("coordOutputFormatTail", Integer.toString(COORD_FORMAT_TAIL));
|
url.addEncodedQueryParameter("coordOutputFormatTail", Integer.toString(COORD_FORMAT_TAIL));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SuggestLocationsResult jsonStopfinderRequest(final Location constraint, final int maxLocations)
|
protected SuggestLocationsResult jsonStopfinderRequest(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
final HttpUrl.Builder url = stopFinderEndpoint.newBuilder();
|
final HttpUrl.Builder url = stopFinderEndpoint.newBuilder();
|
||||||
appendStopfinderRequestParameters(url, constraint, "JSON", maxLocations);
|
appendStopfinderRequestParameters(url, constraint, "JSON", types, maxLocations);
|
||||||
final CharSequence page = httpClient.get(url.build());
|
final CharSequence page = httpClient.get(url.build());
|
||||||
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT);
|
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT);
|
||||||
|
|
||||||
|
@ -350,30 +350,35 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
return new SuggestedLocation(location, quality);
|
return new SuggestedLocation(location, quality);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void appendStopfinderRequestParameters(final HttpUrl.Builder url, final Location constraint,
|
private void appendStopfinderRequestParameters(final HttpUrl.Builder url, final CharSequence constraint,
|
||||||
final String outputFormat, final int maxLocations) {
|
final String outputFormat, final @Nullable Set<LocationType> types, final int maxLocations) {
|
||||||
appendCommonRequestParams(url, outputFormat);
|
appendCommonRequestParams(url, outputFormat);
|
||||||
url.addEncodedQueryParameter("locationServerActive", "1");
|
url.addEncodedQueryParameter("locationServerActive", "1");
|
||||||
if (includeRegionId)
|
if (includeRegionId)
|
||||||
url.addEncodedQueryParameter("regionID_sf", "1"); // prefer own region
|
url.addEncodedQueryParameter("regionID_sf", "1"); // prefer own region
|
||||||
appendLocationParams(url, constraint, "sf");
|
url.addEncodedQueryParameter("type_sf", "any");
|
||||||
if (constraint.type == LocationType.ANY) {
|
url.addEncodedQueryParameter("name_sf", ParserUtils.urlEncode(constraint.toString(), requestUrlEncoding));
|
||||||
if (needsSpEncId)
|
if (needsSpEncId)
|
||||||
url.addEncodedQueryParameter("SpEncId", "0");
|
url.addEncodedQueryParameter("SpEncId", "0");
|
||||||
// 1=place 2=stop 4=street 8=address 16=crossing 32=poi 64=postcode
|
int filter = 0;
|
||||||
url.addEncodedQueryParameter("anyObjFilter_sf", Integer.toString(2 + 4 + 8 + 16 + 32 + 64));
|
if (types == null || types.contains(LocationType.STATION))
|
||||||
|
filter += 2; // stop
|
||||||
|
if (types == null || types.contains(LocationType.POI))
|
||||||
|
filter += 32; // poi
|
||||||
|
if (types == null || types.contains(LocationType.ADDRESS))
|
||||||
|
filter += 4 + 8 + 16 + 64; // street + address + crossing + postcode
|
||||||
|
url.addEncodedQueryParameter("anyObjFilter_sf", Integer.toString(filter));
|
||||||
url.addEncodedQueryParameter("reducedAnyPostcodeObjFilter_sf", "64");
|
url.addEncodedQueryParameter("reducedAnyPostcodeObjFilter_sf", "64");
|
||||||
url.addEncodedQueryParameter("reducedAnyTooManyObjFilter_sf", "2");
|
url.addEncodedQueryParameter("reducedAnyTooManyObjFilter_sf", "2");
|
||||||
url.addEncodedQueryParameter("useHouseNumberList", "true");
|
url.addEncodedQueryParameter("useHouseNumberList", "true");
|
||||||
if (maxLocations > 0)
|
if (maxLocations > 0)
|
||||||
url.addEncodedQueryParameter("anyMaxSizeHitList", Integer.toString(maxLocations));
|
url.addEncodedQueryParameter("anyMaxSizeHitList", Integer.toString(maxLocations));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected SuggestLocationsResult mobileStopfinderRequest(final Location constraint, final int maxLocations)
|
protected SuggestLocationsResult mobileStopfinderRequest(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
final HttpUrl.Builder url = stopFinderEndpoint.newBuilder();
|
final HttpUrl.Builder url = stopFinderEndpoint.newBuilder();
|
||||||
appendStopfinderRequestParameters(url, constraint, "XML", maxLocations);
|
appendStopfinderRequestParameters(url, constraint, "XML", types, maxLocations);
|
||||||
final AtomicReference<SuggestLocationsResult> result = new AtomicReference<>();
|
final AtomicReference<SuggestLocationsResult> result = new AtomicReference<>();
|
||||||
|
|
||||||
final HttpClient.Callback callback = new HttpClient.Callback() {
|
final HttpClient.Callback callback = new HttpClient.Callback() {
|
||||||
|
@ -607,9 +612,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint, final int maxLocations)
|
public SuggestLocationsResult suggestLocations(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
return jsonStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()), maxLocations);
|
return jsonStopfinderRequest(constraint, types, maxLocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
private interface ProcessItdOdvCallback {
|
private interface ProcessItdOdvCallback {
|
||||||
|
|
|
@ -196,9 +196,9 @@ public abstract class AbstractHafasClientInterfaceProvider extends AbstractHafas
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint, final int maxLocations)
|
public SuggestLocationsResult suggestLocations(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
return jsonLocMatch(constraint, null, maxLocations);
|
return jsonLocMatch(constraint, types, maxLocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -295,8 +295,8 @@ public abstract class AbstractHafasLegacyProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint, final int maxLocations)
|
public SuggestLocationsResult suggestLocations(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
final HttpUrl.Builder url = getStopEndpoint.newBuilder().addPathSegment(apiLanguage);
|
final HttpUrl.Builder url = getStopEndpoint.newBuilder().addPathSegment(apiLanguage);
|
||||||
appendJsonGetStopsParameters(url, checkNotNull(constraint), maxLocations);
|
appendJsonGetStopsParameters(url, checkNotNull(constraint), maxLocations);
|
||||||
return jsonGetStops(url.build());
|
return jsonGetStops(url.build());
|
||||||
|
@ -701,7 +701,7 @@ public abstract class AbstractHafasLegacyProvider extends AbstractHafasProvider
|
||||||
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT);
|
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT);
|
||||||
|
|
||||||
if (!from.isIdentified()) {
|
if (!from.isIdentified()) {
|
||||||
final List<Location> locations = suggestLocations(from.name, 0).getLocations();
|
final List<Location> locations = suggestLocations(from.name, null, 0).getLocations();
|
||||||
if (locations.isEmpty())
|
if (locations.isEmpty())
|
||||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||||
if (locations.size() > 1)
|
if (locations.size() > 1)
|
||||||
|
@ -710,7 +710,7 @@ public abstract class AbstractHafasLegacyProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
if (via != null && !via.isIdentified()) {
|
if (via != null && !via.isIdentified()) {
|
||||||
final List<Location> locations = suggestLocations(via.name, 0).getLocations();
|
final List<Location> locations = suggestLocations(via.name, null, 0).getLocations();
|
||||||
if (locations.isEmpty())
|
if (locations.isEmpty())
|
||||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||||
if (locations.size() > 1)
|
if (locations.size() > 1)
|
||||||
|
@ -719,7 +719,7 @@ public abstract class AbstractHafasLegacyProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!to.isIdentified()) {
|
if (!to.isIdentified()) {
|
||||||
final List<Location> locations = suggestLocations(to.name, 0).getLocations();
|
final List<Location> locations = suggestLocations(to.name, null, 0).getLocations();
|
||||||
if (locations.isEmpty())
|
if (locations.isEmpty())
|
||||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||||
if (locations.size() > 1)
|
if (locations.size() > 1)
|
||||||
|
@ -1360,7 +1360,7 @@ public abstract class AbstractHafasLegacyProvider extends AbstractHafasProvider
|
||||||
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT);
|
final ResultHeader header = new ResultHeader(network, SERVER_PRODUCT);
|
||||||
|
|
||||||
if (!from.isIdentified()) {
|
if (!from.isIdentified()) {
|
||||||
final List<Location> locations = suggestLocations(from.name, 0).getLocations();
|
final List<Location> locations = suggestLocations(from.name, null, 0).getLocations();
|
||||||
if (locations.isEmpty())
|
if (locations.isEmpty())
|
||||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||||
if (locations.size() > 1)
|
if (locations.size() > 1)
|
||||||
|
@ -1369,7 +1369,7 @@ public abstract class AbstractHafasLegacyProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
if (via != null && !via.isIdentified()) {
|
if (via != null && !via.isIdentified()) {
|
||||||
final List<Location> locations = suggestLocations(via.name, 0).getLocations();
|
final List<Location> locations = suggestLocations(via.name, null, 0).getLocations();
|
||||||
if (locations.isEmpty())
|
if (locations.isEmpty())
|
||||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||||
if (locations.size() > 1)
|
if (locations.size() > 1)
|
||||||
|
@ -1378,7 +1378,7 @@ public abstract class AbstractHafasLegacyProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!to.isIdentified()) {
|
if (!to.isIdentified()) {
|
||||||
final List<Location> locations = suggestLocations(to.name, 0).getLocations();
|
final List<Location> locations = suggestLocations(to.name, null, 0).getLocations();
|
||||||
if (locations.isEmpty())
|
if (locations.isEmpty())
|
||||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||||
if (locations.size() > 1)
|
if (locations.size() > 1)
|
||||||
|
|
|
@ -845,14 +845,17 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint, final int maxLocations)
|
public SuggestLocationsResult suggestLocations(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
final String nameCstr = constraint.toString();
|
final String nameCstr = constraint.toString();
|
||||||
|
|
||||||
final HttpUrl.Builder url = url().addPathSegment("places");
|
final HttpUrl.Builder url = url().addPathSegment("places");
|
||||||
url.addQueryParameter("q", nameCstr);
|
url.addQueryParameter("q", nameCstr);
|
||||||
|
if (types == null || types.contains(LocationType.ANY) || types.contains(LocationType.STATION))
|
||||||
url.addQueryParameter("type[]", "stop_area");
|
url.addQueryParameter("type[]", "stop_area");
|
||||||
|
if (types == null || types.contains(LocationType.ANY) || types.contains(LocationType.ADDRESS))
|
||||||
url.addQueryParameter("type[]", "address");
|
url.addQueryParameter("type[]", "address");
|
||||||
|
if (types == null || types.contains(LocationType.ANY) || types.contains(LocationType.POI))
|
||||||
url.addQueryParameter("type[]", "poi");
|
url.addQueryParameter("type[]", "poi");
|
||||||
url.addQueryParameter("type[]", "administrative_region");
|
url.addQueryParameter("type[]", "administrative_region");
|
||||||
url.addQueryParameter("depth", "1");
|
url.addQueryParameter("depth", "1");
|
||||||
|
@ -1009,7 +1012,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider {
|
||||||
Location newFrom = null, newTo = null;
|
Location newFrom = null, newTo = null;
|
||||||
|
|
||||||
if (!from.isIdentified() && from.hasName()) {
|
if (!from.isIdentified() && from.hasName()) {
|
||||||
ambiguousFrom = suggestLocations(from.name, 0).getLocations();
|
ambiguousFrom = suggestLocations(from.name, null, 0).getLocations();
|
||||||
if (ambiguousFrom.isEmpty())
|
if (ambiguousFrom.isEmpty())
|
||||||
return new QueryTripsResult(resultHeader, QueryTripsResult.Status.UNKNOWN_FROM);
|
return new QueryTripsResult(resultHeader, QueryTripsResult.Status.UNKNOWN_FROM);
|
||||||
if (ambiguousFrom.size() == 1 && ambiguousFrom.get(0).isIdentified())
|
if (ambiguousFrom.size() == 1 && ambiguousFrom.get(0).isIdentified())
|
||||||
|
@ -1017,7 +1020,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!to.isIdentified() && to.hasName()) {
|
if (!to.isIdentified() && to.hasName()) {
|
||||||
ambiguousTo = suggestLocations(to.name, 0).getLocations();
|
ambiguousTo = suggestLocations(to.name, null, 0).getLocations();
|
||||||
if (ambiguousTo.isEmpty())
|
if (ambiguousTo.isEmpty())
|
||||||
return new QueryTripsResult(resultHeader, QueryTripsResult.Status.UNKNOWN_TO);
|
return new QueryTripsResult(resultHeader, QueryTripsResult.Status.UNKNOWN_TO);
|
||||||
if (ambiguousTo.size() == 1 && ambiguousTo.get(0).isIdentified())
|
if (ambiguousTo.size() == 1 && ambiguousTo.get(0).isIdentified())
|
||||||
|
|
|
@ -81,7 +81,7 @@ public abstract class AbstractNetworkProvider implements NetworkProvider {
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public final SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException {
|
public final SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException {
|
||||||
return suggestLocations(constraint, 0);
|
return suggestLocations(constraint, null, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
|
|
@ -130,9 +130,9 @@ public class BayernProvider extends AbstractEfaProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint, final int maxLocations)
|
public SuggestLocationsResult suggestLocations(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
return mobileStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()), maxLocations);
|
return mobileStopfinderRequest(constraint, types, maxLocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -827,7 +827,8 @@ public class NegentweeProvider extends AbstractNetworkProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuggestLocationsResult suggestLocations(CharSequence constraint, int maxLocations) throws IOException {
|
public SuggestLocationsResult suggestLocations(CharSequence constraint, @Nullable Set<LocationType> types,
|
||||||
|
int maxLocations) throws IOException {
|
||||||
HttpUrl url = buildApiUrl("locations", Arrays.asList(new QueryParameter("q", constraint.toString())));
|
HttpUrl url = buildApiUrl("locations", Arrays.asList(new QueryParameter("q", constraint.toString())));
|
||||||
final CharSequence page;
|
final CharSequence page;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -112,12 +112,15 @@ public interface NetworkProvider {
|
||||||
*
|
*
|
||||||
* @param constraint
|
* @param constraint
|
||||||
* input by user so far
|
* input by user so far
|
||||||
|
* @param types
|
||||||
|
* types of locations to suggest, or {@code null} for any
|
||||||
* @param maxLocations
|
* @param maxLocations
|
||||||
* maximum number of locations to suggest or {@code 0}
|
* maximum number of locations to suggest or {@code 0}
|
||||||
* @return location suggestions
|
* @return location suggestions
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
SuggestLocationsResult suggestLocations(CharSequence constraint, int maxLocations) throws IOException;
|
SuggestLocationsResult suggestLocations(CharSequence constraint, @Nullable Set<LocationType> types,
|
||||||
|
int maxLocations) throws IOException;
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
SuggestLocationsResult suggestLocations(CharSequence constraint) throws IOException;
|
SuggestLocationsResult suggestLocations(CharSequence constraint) throws IOException;
|
||||||
|
|
|
@ -72,9 +72,9 @@ public class StvProvider extends AbstractEfaProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint, final int maxLocations)
|
public SuggestLocationsResult suggestLocations(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
return mobileStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()), maxLocations);
|
return mobileStopfinderRequest(constraint, types, maxLocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -28,6 +28,7 @@ import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Currency;
|
import java.util.Currency;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -573,14 +574,14 @@ public class VrsProvider extends AbstractNetworkProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint, final int maxLocations)
|
public SuggestLocationsResult suggestLocations(final CharSequence constraint,
|
||||||
throws IOException {
|
final @Nullable Set<LocationType> types, final int maxLocations) throws IOException {
|
||||||
// sc = station count
|
// sc = station count
|
||||||
final int sc = maxLocations / 2;
|
final int sc = EnumSet.of(LocationType.STATION).equals(types) ? maxLocations : maxLocations / 2;
|
||||||
// ac = address count
|
// ac = address count
|
||||||
final int ac = maxLocations / 4;
|
final int ac = EnumSet.of(LocationType.ADDRESS).equals(types) ? maxLocations : maxLocations / 4;
|
||||||
// pc = points of interest count
|
// pc = points of interest count
|
||||||
final int pc = maxLocations / 4;
|
final int pc = EnumSet.of(LocationType.POI).equals(types) ? maxLocations : maxLocations / 4;
|
||||||
// t = sap (stops and/or addresses and/or pois)
|
// t = sap (stops and/or addresses and/or pois)
|
||||||
final HttpUrl.Builder url = API_BASE.newBuilder();
|
final HttpUrl.Builder url = API_BASE.newBuilder();
|
||||||
url.addQueryParameter("eID", "tx_vrsinfo_ass2_objects");
|
url.addQueryParameter("eID", "tx_vrsinfo_ass2_objects");
|
||||||
|
@ -1127,7 +1128,7 @@ public class VrsProvider extends AbstractNetworkProvider {
|
||||||
} else if (loc.coord != null) {
|
} else if (loc.coord != null) {
|
||||||
return String.format(Locale.ENGLISH, "%f,%f", loc.getLatAsDouble(), loc.getLonAsDouble());
|
return String.format(Locale.ENGLISH, "%f,%f", loc.getLatAsDouble(), loc.getLonAsDouble());
|
||||||
} else {
|
} else {
|
||||||
SuggestLocationsResult suggestLocationsResult = suggestLocations(loc.name, 0);
|
SuggestLocationsResult suggestLocationsResult = suggestLocations(loc.name, null, 0);
|
||||||
final List<Location> suggestedLocations = suggestLocationsResult.getLocations();
|
final List<Location> suggestedLocations = suggestLocationsResult.getLocations();
|
||||||
if (suggestedLocations.size() == 1) {
|
if (suggestedLocations.size() == 1) {
|
||||||
return suggestedLocations.get(0).id;
|
return suggestedLocations.get(0).id;
|
||||||
|
|
|
@ -115,7 +115,7 @@ public abstract class AbstractProviderLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException {
|
protected final SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException {
|
||||||
return provider.suggestLocations(constraint, 0);
|
return provider.suggestLocations(constraint, null, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final QueryTripsResult queryTrips(final Location from, final @Nullable Location via, final Location to,
|
protected final QueryTripsResult queryTrips(final Location from, final @Nullable Location via, final Location to,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue