mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-10 20:48:47 +00:00
AbstractEfaProvider: Simplify instantiation of destination locations.
This commit is contained in:
parent
c396ebe508
commit
a60f8b049f
1 changed files with 8 additions and 8 deletions
|
@ -1506,10 +1506,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
final String destinationIdStr = XmlPullUtil.optAttr(pp, "destID", null);
|
final String destinationIdStr = XmlPullUtil.optAttr(pp, "destID", null);
|
||||||
final String destinationId = !"-1".equals(destinationIdStr) ? destinationIdStr : null;
|
final String destinationId = !"-1".equals(destinationIdStr) ? destinationIdStr : null;
|
||||||
final Location destination;
|
final Location destination;
|
||||||
if (destinationId != null || destinationName != null)
|
if (destinationId != null)
|
||||||
destination = new Location(
|
destination = new Location(LocationType.STATION, destinationId, null, destinationName);
|
||||||
destinationId != null ? LocationType.STATION : LocationType.ANY, destinationId,
|
else if (destinationId == null && destinationName != null)
|
||||||
null, destinationName);
|
destination = new Location(LocationType.ANY, null, null, destinationName);
|
||||||
else
|
else
|
||||||
destination = null;
|
destination = null;
|
||||||
|
|
||||||
|
@ -1576,10 +1576,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
||||||
final String destinationIdStr = XmlPullUtil.optAttr(pp, "destID", null);
|
final String destinationIdStr = XmlPullUtil.optAttr(pp, "destID", null);
|
||||||
final String destinationId = !"-1".equals(destinationIdStr) ? destinationIdStr : null;
|
final String destinationId = !"-1".equals(destinationIdStr) ? destinationIdStr : null;
|
||||||
final Location destination;
|
final Location destination;
|
||||||
if (destinationId != null || destinationName != null)
|
if (destinationId != null)
|
||||||
destination = new Location(
|
destination = new Location(LocationType.STATION, destinationId, null, destinationName);
|
||||||
destinationId != null ? LocationType.STATION : LocationType.ANY, destinationId,
|
else if (destinationId == null && destinationName != null)
|
||||||
null, destinationName);
|
destination = new Location(LocationType.ANY, null, null, destinationName);
|
||||||
else
|
else
|
||||||
destination = null;
|
destination = null;
|
||||||
final Line line = processItdServingLine(pp);
|
final Line line = processItdServingLine(pp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue