Files
alda-2025-appointmentplanner/assignment/src/main/java/appointmentplanner/APFactory.java
2025-10-23 21:20:33 +02:00

45 lines
1.2 KiB
Java

package appointmentplanner;
/*
* Copyright (c) 2019 Informatics Fontys FHTenL University of Applied Science Venlo
*/
import appointmentplanner.api.*;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalTime;
/**
* Abstract factory to separate student implementations from teachers tests. The
* instance created by this factory will be black-box tested by the teachers
* tests.
*
* Richard van den Ham {@code r.vandenham@fontys.nl}
* Pieter van den Hombergh {@code p.vandenhombergh@fontys.nl}
*/
public class APFactory implements AbstractAPFactory {
/**
* Creates a factory.
*/
public APFactory() {
}
@Override
public LocalDayPlan createLocalDayPlan(LocalDay day, Instant start, Instant end) {
return new LocalDayPlanImpl(day, start, end);
}
@Override
public AppointmentData createAppointmentData(String description, Duration duration) {
return new AppointmentDataImpl(duration, description);
}
@Override
public AppointmentRequest createAppointmentRequest(AppointmentData appData, LocalTime prefStart,
TimePreference fallBack) {
return new AppointmentRequestImpl(appData, prefStart, fallBack);
}
}