Search in sources :

Example 1 with DayTypeAssignment

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());
}
Also used : DayTypeAssignment(org.rutebanken.netex.model.DayTypeAssignment) Test(org.junit.Test)

Example 2 with DayTypeAssignment

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;
}
Also used : DayTypeAssignment(org.rutebanken.netex.model.DayTypeAssignment)

Example 3 with DayTypeAssignment

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);
    }
}
Also used : DayTypeAssignment(org.rutebanken.netex.model.DayTypeAssignment)

Example 4 with DayTypeAssignment

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);
    }
}
Also used : DayTypeAssignment(org.rutebanken.netex.model.DayTypeAssignment)

Aggregations

DayTypeAssignment (org.rutebanken.netex.model.DayTypeAssignment)4 Test (org.junit.Test)1