Releases: Siroshun09/Event4J
Releases · Siroshun09/Event4J
Version 4.0.1
- Add missing javadoc
- Fix deploying javadoc page
Version 4.0.0
Changes from v3
- The module name and package has been renamed to
dev.siroshun.event4j
- Redesign API structure and its implementation
- The implementation of API has been moved to own module (
event4j-tree
)
Version 4.0.0-rc.2
release: version 4.0.0-rc.2
Version 4.0.0-rc.1
release: version 4.0.0-rc.1
Version 3.2.1
- Optimize the process that consumes
PostResult
- Update dependencies
Version 3.2.0
Remove deprecated method
EventBus#unsubscribeAll(MultipleListeners)
Version 3.1.0
Addition
EventBus#unsubscribe(SubscribedListener)
andEventBus#unsubscribeAll(List)
Deprecates for Removal
EventBus#unsubscribeAll(MultipleListeners)
- MultipleListeners instances should not be held in the EventBus; unsubscribing a listener using Key will not remove the MultipleListeners instance from the map.
Version 3.0.1
Version 3.0.0
API Changes
EventBus
can have any event type.- The default
EventBus
created byEventBus#create
uses Event as the top-level event type.
- The default
HandlerList
has been renamed toEventSubscriber
- To get the
EventSubscriber
, useEventBus#getSubscriber(Class)
- To get the
EventSubscriber#post
(HandlerList#post
in v2) returnsPostResult
EventBus
andEventSubscriber
is closeable (not Java'sCloseable
).EventSubscriber#subscribe
(HandlerList#subscribe
in v2) returnsSubscribedListener
.Priority#of
->Priority#value
Added APIs
PostResult
PostResult
indicates the result of posting the event to listeners in the EventSubscriber
.
To use this, add Consumer<PostResult<?>>
to EventBus
(EventBus#addResultConsumer
).
MultipleListeners
MultipleListeners
is an interface to create multiple listeners in the class.
Example:
public class SampleListeners implements MultipleListeners {
@Subscribe
public void onEventNormal(@NotNull Event event) {
// do something
}
@Subscribe(priority = Priority.HIGH_VALUE)
public void onEventHigh(@NotNull Event event) {
// do something
}
}
To subscribe listeners, use EventBus#subscribeAll
.
For more information, please read the Javadoc.
Version 2.2.0
add EventBus#callEventAsync