- Hands-On Design Patterns with Java
- Dr. Edward Lavieri
- 64字
- 2021-06-24 14:58:03
University email handler interface
The UniversityEmailHandler interface has two methods. The first method, setNextEmailHandler(), accepts a UniversityEmailHandler argument, which will be the next handler in the chain of authority. The second method, processEmailHandler(), is used if the email is processed by the current handler:
public interface UniversityEmailHandler {
public void setNextEmailHandler(UniversityEmailHandler emailHandler);
public void processEmailHandler(String emailText);
}
The preceding code explains the handler interface.