-
-
Save chermehdi/7ce4230ce0dc40643f71b3a29e82ef4f to your computer and use it in GitHub Desktop.
Subscribable Contract
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.chermehdi.bus; | |
import java.util.Set; | |
/** | |
* Description of a generic subscriber | |
* | |
* @author chermehdi | |
*/ | |
public interface Subscribable { | |
/** | |
* Consume the events dispatched by the bus, events passed as parameter are can only be of type | |
* declared by the supports() Set | |
*/ | |
void handle(Event<?> event); | |
/** | |
* describes the set of classes the subscribable object intends to handle | |
*/ | |
Set<Class<?>> supports(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment