Skip to content

Commit 80ba6f5

Browse files
committed
Topograhic place, parking, scheduled stop point and group of tariff zones are also versioned
1 parent f29ca96 commit 80ba6f5

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

src/main/java/org/entur/netex/index/api/NetexEntitiesIndex.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,19 @@ public interface NetexEntitiesIndex {
252252
* Get an entity index of TopographicPlace
253253
* @return
254254
*/
255-
NetexEntityIndex<TopographicPlace> getTopographicPlaceIndex();
255+
VersionedNetexEntityIndex<TopographicPlace> getTopographicPlaceIndex();
256256

257257
/**
258258
* Get an entity index of Parking
259259
* @return
260260
*/
261-
NetexEntityIndex<Parking> getParkingIndex();
261+
VersionedNetexEntityIndex<Parking> getParkingIndex();
262262

263263
/**
264264
* Get an entity index of ScheduledStopPoint
265265
* @return
266266
*/
267-
NetexEntityIndex<ScheduledStopPoint> getScheduledStopPointIndex();
267+
VersionedNetexEntityIndex<ScheduledStopPoint> getScheduledStopPointIndex();
268268

269269
/**
270270
* Get an entity index of RoutePoint
@@ -284,7 +284,7 @@ public interface NetexEntitiesIndex {
284284
*/
285285
VersionedNetexEntityIndex<FareZone> getFareZoneIndex();
286286

287-
NetexEntityIndex<GroupOfTariffZones> getGroupOfTariffZonesIndex();
287+
VersionedNetexEntityIndex<GroupOfTariffZones> getGroupOfTariffZonesIndex();
288288

289289
Collection<CompositeFrame> getCompositeFrames();
290290
Collection<ResourceFrame> getResourceFrames();

src/main/java/org/entur/netex/index/impl/NetexEntitiesIndexImpl.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ public class NetexEntitiesIndexImpl implements NetexEntitiesIndex {
8888
public final NetexEntityIndex<ServiceLink> serviceLinkById;
8989
public final VersionedNetexEntityIndex<StopPlace> stopPlaceById;
9090
public final VersionedNetexEntityIndex<TariffZone> tariffZonesById;
91-
public final NetexEntityIndex<TopographicPlace> topographicPlaceById;
92-
public final NetexEntityIndex<Parking> parkingById;
93-
public final NetexEntityIndex<ScheduledStopPoint> scheduledStopPointById;
91+
public final VersionedNetexEntityIndex<TopographicPlace> topographicPlaceById;
92+
public final VersionedNetexEntityIndex<Parking> parkingById;
93+
public final VersionedNetexEntityIndex<ScheduledStopPoint> scheduledStopPointById;
9494
public final NetexEntityIndex<RoutePoint> routePointById;
9595
public final VersionedNetexEntityIndex<FareZone> fareZoneById;
96-
public final NetexEntityIndex<GroupOfTariffZones> groupOfTariffZonesById;
96+
public final VersionedNetexEntityIndex<GroupOfTariffZones> groupOfTariffZonesById;
9797
public final Multimap<String, Parking> parkingsByParentSiteRef;
9898

9999
// Relations between entities - The Netex XML sometimes rely on the the
@@ -147,12 +147,12 @@ public NetexEntitiesIndexImpl() {
147147
this.serviceLinkById = new NetexEntityMapByIdImpl<>();
148148
this.stopPlaceById = new VersionedNetexEntityIndexImpl<>();
149149
this.tariffZonesById = new VersionedNetexEntityIndexImpl<>();
150-
this.topographicPlaceById = new NetexEntityMapByIdImpl<>();
151-
this.parkingById = new NetexEntityMapByIdImpl<>();
152-
this.scheduledStopPointById = new NetexEntityMapByIdImpl<>();
150+
this.topographicPlaceById = new VersionedNetexEntityIndexImpl<>();
151+
this.parkingById = new VersionedNetexEntityIndexImpl<>();
152+
this.scheduledStopPointById = new VersionedNetexEntityIndexImpl<>();
153153
this.routePointById = new NetexEntityMapByIdImpl<>();
154154
this.fareZoneById = new VersionedNetexEntityIndexImpl<>();
155-
this.groupOfTariffZonesById = new NetexEntityMapByIdImpl<>();
155+
this.groupOfTariffZonesById = new VersionedNetexEntityIndexImpl<>();
156156
this.compositeFrames = new HashSet<>();
157157
this.siteFrames = new HashSet<>();
158158
this.resourceFrames = new HashSet<>();
@@ -328,17 +328,17 @@ public VersionedNetexEntityIndex<TariffZone> getTariffZoneIndex() {
328328
}
329329

330330
@Override
331-
public NetexEntityIndex<TopographicPlace> getTopographicPlaceIndex() {
331+
public VersionedNetexEntityIndex<TopographicPlace> getTopographicPlaceIndex() {
332332
return topographicPlaceById;
333333
}
334334

335335
@Override
336-
public NetexEntityIndex<Parking> getParkingIndex() {
336+
public VersionedNetexEntityIndex<Parking> getParkingIndex() {
337337
return parkingById;
338338
}
339339

340340
@Override
341-
public NetexEntityIndex<ScheduledStopPoint> getScheduledStopPointIndex() {
341+
public VersionedNetexEntityIndex<ScheduledStopPoint> getScheduledStopPointIndex() {
342342
return scheduledStopPointById;
343343
}
344344

@@ -353,7 +353,7 @@ public VersionedNetexEntityIndex<FareZone> getFareZoneIndex() {
353353
}
354354

355355
@Override
356-
public NetexEntityIndex<GroupOfTariffZones> getGroupOfTariffZonesIndex() {
356+
public VersionedNetexEntityIndex<GroupOfTariffZones> getGroupOfTariffZonesIndex() {
357357
return groupOfTariffZonesById;
358358
}
359359

src/test/java/org/entur/netex/TestGroupOfTariffZones.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void init() {
2626

2727
@Test
2828
void testGetAllGroupsOfTariffZones() {
29-
Collection<GroupOfTariffZones> groups = index.getGroupOfTariffZonesIndex().getAll();
29+
Collection<GroupOfTariffZones> groups = index.getGroupOfTariffZonesIndex().getLatestVersions();
3030
Assertions.assertFalse(groups.isEmpty());
3131
}
3232
}

src/test/java/org/entur/netex/TestStopPlacesExport.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,26 @@ void testGetTariffZone() {
6262

6363
@Test
6464
void testGetTopographicPlace() {
65-
TopographicPlace topographicPlace = index.getTopographicPlaceIndex().get("KVE:TopographicPlace:50");
65+
TopographicPlace topographicPlace = index.getTopographicPlaceIndex().getLatestVersion("KVE:TopographicPlace:50");
6666
Assertions.assertEquals("Trøndelag", topographicPlace.getDescriptor().getName().getValue());
6767
Assertions.assertEquals("no", topographicPlace.getCountryRef().getRef().value());
6868
}
6969

7070
@Test
7171
void testGetParking() {
72-
Parking parking = index.getParkingIndex().get("NSR:Parking:1");
72+
Parking parking = index.getParkingIndex().getLatestVersion("NSR:Parking:1");
7373
Assertions.assertEquals("Drammen", parking.getName().getValue());
7474
}
7575

7676
@Test
7777
void testGetScheduledStopPoint() {
78-
ScheduledStopPoint scheduledStopPoint = index.getScheduledStopPointIndex().get("NSR:ScheduledStopPoint:S5");
78+
ScheduledStopPoint scheduledStopPoint = index.getScheduledStopPointIndex().getLatestVersion("NSR:ScheduledStopPoint:S5");
7979
Assertions.assertEquals("Gudå", scheduledStopPoint.getName().getValue());
8080
}
8181

8282
@Test
8383
void testGetPassengerStopAssignment() {
84-
ScheduledStopPoint scheduledStopPoint = index.getScheduledStopPointIndex().get("NSR:ScheduledStopPoint:S5");
84+
ScheduledStopPoint scheduledStopPoint = index.getScheduledStopPointIndex().getLatestVersion("NSR:ScheduledStopPoint:S5");
8585
Collection<PassengerStopAssignment> passengerStopAssignments = index.getPassengerStopAssignmentsByStopPointRefIndex().get(scheduledStopPoint.getId());
8686

8787
Assertions.assertEquals(1, passengerStopAssignments.size());

0 commit comments

Comments
 (0)