mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 06:08:52 +00:00
Change NetworkProvider.queryTrips() signature to accept a Set of products rather than a Collection.
This commit is contained in:
parent
5efdafc05e
commit
0a571554c5
12 changed files with 14 additions and 33 deletions
|
@ -2086,8 +2086,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
|
||||
final String parameters = xsltTripRequestParameters(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||
|
|
|
@ -763,8 +763,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
}
|
||||
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.text.ParseException;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedList;
|
||||
|
@ -985,8 +984,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
final ResultHeader resultHeader = new ResultHeader(SERVER_PRODUCT, SERVER_VERSION, 0, null);
|
||||
|
||||
|
|
|
@ -635,8 +635,7 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
}
|
||||
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
final List<Location> possibleFroms, possibleTos, possibleVias;
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
@ -131,8 +130,7 @@ public class BayernProvider extends AbstractEfaProvider
|
|||
|
||||
@Override
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
return queryTripsMobile(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
|
@ -91,8 +90,7 @@ public class EireannProvider extends AbstractHafasProvider
|
|||
|
||||
@Override
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
return queryTripsXml(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
|
@ -307,8 +306,7 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
|
||||
@Override
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
return queryTripsXml(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
@ -145,7 +144,7 @@ public interface NetworkProvider
|
|||
* @return result object that can contain alternatives to clear up ambiguousnesses, or contains possible trips
|
||||
* @throws IOException
|
||||
*/
|
||||
QueryTripsResult queryTrips(Location from, Location via, Location to, Date date, boolean dep, Collection<Product> products, WalkSpeed walkSpeed,
|
||||
QueryTripsResult queryTrips(Location from, Location via, Location to, Date date, boolean dep, Set<Product> products, WalkSpeed walkSpeed,
|
||||
Accessibility accessibility, Set<Option> options) throws IOException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -132,8 +131,7 @@ public class NriProvider extends AbstractHafasProvider
|
|||
|
||||
@Override
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
return queryTripsXml(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
|
@ -284,8 +283,7 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
|
||||
@Override
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options) throws IOException
|
||||
{
|
||||
return queryTripsXml(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import de.schildbach.pte.NetworkProvider;
|
||||
import de.schildbach.pte.NetworkProvider.Accessibility;
|
||||
|
@ -121,7 +121,7 @@ public abstract class AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
protected final QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility) throws IOException
|
||||
final Set<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility) throws IOException
|
||||
{
|
||||
return provider.queryTrips(from, via, to, date, dep, products, walkSpeed, accessibility, null);
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@ import static org.junit.Assert.assertTrue;
|
|||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -216,10 +214,9 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void queryTripNoSolution() throws Exception
|
||||
{
|
||||
final List<Product> emptyList = new LinkedList<Product>();
|
||||
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "stop_point:RTP:SP:3926410"), null, new Location(
|
||||
LocationType.STATION, "stop_point:RTP:SP:3926410"), new Date(), true, emptyList, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
LocationType.STATION, "stop_point:RTP:SP:3926410"), new Date(), true, EnumSet.noneOf(Product.class), WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
assertEquals(QueryTripsResult.Status.NO_TRIPS, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue