use of org.rutebanken.netex.model.DayTypeAssignment in project OpenTripPlanner by opentripplanner.
the class NetexImportDataIndexTest method lookupDayTypeAssignment.
@Test
public void lookupDayTypeAssignment() {
DayTypeAssignment dtaA = dayTypeAssignment(ID, REF);
DayTypeAssignment dtaB = dayTypeAssignment(ID, REF_2);
root.dayTypeAssignmentByDayTypeId.add(ID, dtaA);
child.dayTypeAssignmentByDayTypeId.add(ID, dtaB);
assertEquals(singletonList(dtaA), root.dayTypeAssignmentByDayTypeId.lookup(ID));
assertEquals(singletonList(dtaB), child.dayTypeAssignmentByDayTypeId.lookup(ID));
assertTrue(child.dayTypeAssignmentByDayTypeId.lookup(ID_2).isEmpty());
}
use of org.rutebanken.netex.model.DayTypeAssignment in project OpenTripPlanner by opentripplanner.
the class NetexImportDataIndexTest method dayTypeAssignment.
private static DayTypeAssignment dayTypeAssignment(String id, String dataSourceRef) {
DayTypeAssignment value = new DayTypeAssignment();
value.setId(id);
value.withDataSourceRef(dataSourceRef);
return value;
}
use of org.rutebanken.netex.model.DayTypeAssignment in project OpenTripPlanner by opentripplanner.
the class DayTypeAssignmentMapper method mapAll.
/**
* Map all given {@code dayTypeAssignments} for {@code dayTypeId}. The result is kept
* internally in the mapper until all mapping are performed.
* <p>
* Retrieve the results using {@link #mergeDates()}.
*/
void mapAll(String dayTypeId, Collection<DayTypeAssignment> dayTypeAssignments) {
assertNotMerged();
this.dayTypeId = dayTypeId;
for (DayTypeAssignment it : dayTypeAssignments) {
map(it);
}
}
use of org.rutebanken.netex.model.DayTypeAssignment in project OpenTripPlanner by opentripplanner.
the class ServiceCalendarFrameParser method parseRequiredDayTypeAssignments.
private void parseRequiredDayTypeAssignments(List<DayTypeAssignment> elements) {
for (DayTypeAssignment it : elements) {
String ref = it.getDayTypeRef().getValue().getRef();
dayTypeAssignmentByDayTypeId.put(ref, it);
}
}
Aggregations