2024-11-04 09:16:59 +01:00

17 lines
533 B
Java

package lab9_responsibility_chain.ex1.handlers;
import lab9_responsibility_chain.ex1.Email;
import lab9_responsibility_chain.ex1.EmailType;
import lab9_responsibility_chain.ex1.Handler;
public class NewLocHandler extends Handler {
@Override
public void handleEmail(Email email) {
if (email.type() == EmailType.NEW_LOC) {
System.out.println("Forwarding request to business development (" + email + ")");
} else if (successor != null) {
successor.handleEmail(email);
}
}
}