mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-10 18:18: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 destinationId = !"-1".equals(destinationIdStr) ? destinationIdStr : null;
|
||||
final Location destination;
|
||||
if (destinationId != null || destinationName != null)
|
||||
destination = new Location(
|
||||
destinationId != null ? LocationType.STATION : LocationType.ANY, destinationId,
|
||||
null, destinationName);
|
||||
if (destinationId != null)
|
||||
destination = new Location(LocationType.STATION, destinationId, null, destinationName);
|
||||
else if (destinationId == null && destinationName != null)
|
||||
destination = new Location(LocationType.ANY, null, null, destinationName);
|
||||
else
|
||||
destination = null;
|
||||
|
||||
|
@ -1576,10 +1576,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider {
|
|||
final String destinationIdStr = XmlPullUtil.optAttr(pp, "destID", null);
|
||||
final String destinationId = !"-1".equals(destinationIdStr) ? destinationIdStr : null;
|
||||
final Location destination;
|
||||
if (destinationId != null || destinationName != null)
|
||||
destination = new Location(
|
||||
destinationId != null ? LocationType.STATION : LocationType.ANY, destinationId,
|
||||
null, destinationName);
|
||||
if (destinationId != null)
|
||||
destination = new Location(LocationType.STATION, destinationId, null, destinationName);
|
||||
else if (destinationId == null && destinationName != null)
|
||||
destination = new Location(LocationType.ANY, null, null, destinationName);
|
||||
else
|
||||
destination = null;
|
||||
final Line line = processItdServingLine(pp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue