- Hands-On Design Patterns with Java
- Dr. Edward Lavieri
- 87字
- 2021-06-24 14:58:04
Alumni email handler
The AlumnicEmailHandler class extends the MainEmailHandler class. It assigns the keywords specific to the alumni email handler and contains the processEmailFinal() method:
public class AlumniEmailHandler extends MainEmailHandler {
protected String[] keyWords() {
// setup keywords for the receiver team
return new String[] {"alumni", "transcript"};
}
protected void processEmailFinal(String emailText) {
System.out.println("The Alumni Team processed the email.");
}
@Override
public void setNextEmailHandler(UniversityEmailHandler emailHandler) {
}
}
The processEmailFinal() method just shown informs the user that the alumni email handler took care of the received email.