Skip to content

Commit

Permalink
Add new method in Generics Lab
Browse files Browse the repository at this point in the history
  • Loading branch information
Svetlin12 committed Nov 9, 2024
1 parent d3fd210 commit b4e5793
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 05-generics/lab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,16 @@ public interface EventBus {
*/
Collection<? extends Event<?>> getEventLogs(Class<? extends Event<?>> eventType, Instant from,
Instant to);


/**
* Returns all subscribers for the given event type in an unmodifiable collection. If there are
* no subscribers for the event type, the method returns an empty unmodifiable collection.
*
* @param eventType the type of event to get subscribers for
* @return an unmodifiable collection of subscribers for the given event type
* @throws IllegalArgumentException if the event type is null
*/
<T extends Event<?>> Collection<Subscriber<?>> getSubscribersForEvent(Class<T> eventType);
}
```

Expand Down

0 comments on commit b4e5793

Please sign in to comment.