
com.cookingfox.eventbus.adapter.GuavaEventBusAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eventbus-adapter-java Show documentation
Show all versions of eventbus-adapter-java Show documentation
The EventBus Adapter wraps various EventBus implementations for Java and Android.
package com.cookingfox.eventbus.adapter;
import com.cookingfox.eventbus.EventBus;
/**
* Adapter for the Google Guava EventBus. Don't forget to add the library to your dependencies.
*
* @see com.cookingfox.eventbus.EventBus
* @see com.google.common.eventbus.EventBus
*/
public class GuavaEventBusAdapter implements EventBus {
private com.google.common.eventbus.EventBus eventBus;
public GuavaEventBusAdapter(com.google.common.eventbus.EventBus eventBus) {
this.eventBus = eventBus;
}
@Override
public void post(Object event) {
eventBus.post(event);
}
@Override
public void register(Object subscriber) {
eventBus.register(subscriber);
}
@Override
public void unregister(Object subscriber) {
eventBus.unregister(subscriber);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy