public class EventBusBuilder
extends java.lang.Object
EventBus.builder()
.Modifier and Type | Method and Description |
---|---|
EventBusBuilder |
addIndex(SubscriberInfoIndex index)
Adds an index generated by EventBus' annotation preprocessor.
|
EventBus |
build()
Builds an EventBus based on the current configuration.
|
EventBusBuilder |
eventInheritance(boolean eventInheritance)
By default, EventBus considers the event class hierarchy (subscribers to super classes will be notified).
|
EventBusBuilder |
executorService(java.util.concurrent.ExecutorService executorService)
Provide a custom thread pool to EventBus used for async and background event delivery.
|
EventBusBuilder |
ignoreGeneratedIndex(boolean ignoreGeneratedIndex)
Forces the use of reflection even if there's a generated index (default: false).
|
EventBus |
installDefaultEventBus()
Installs the default EventBus returned by
EventBus.getDefault() using this builders' values. |
EventBusBuilder |
logNoSubscriberMessages(boolean logNoSubscriberMessages)
Default: true
|
EventBusBuilder |
logSubscriberExceptions(boolean logSubscriberExceptions)
Default: true
|
EventBusBuilder |
sendNoSubscriberEvent(boolean sendNoSubscriberEvent)
Default: true
|
EventBusBuilder |
sendSubscriberExceptionEvent(boolean sendSubscriberExceptionEvent)
Default: true
|
EventBusBuilder |
skipMethodVerificationFor(java.lang.Class<?> clazz)
Method name verification is done for methods starting with onEvent to avoid typos; using this method you can
exclude subscriber classes from this check.
|
EventBusBuilder |
strictMethodVerification(boolean strictMethodVerification)
Enables strict method verification (default: false).
|
EventBusBuilder |
throwSubscriberException(boolean throwSubscriberException)
Fails if an subscriber throws an exception (default: false).
|
public EventBusBuilder logSubscriberExceptions(boolean logSubscriberExceptions)
public EventBusBuilder logNoSubscriberMessages(boolean logNoSubscriberMessages)
public EventBusBuilder sendSubscriberExceptionEvent(boolean sendSubscriberExceptionEvent)
public EventBusBuilder sendNoSubscriberEvent(boolean sendNoSubscriberEvent)
public EventBusBuilder throwSubscriberException(boolean throwSubscriberException)
public EventBusBuilder eventInheritance(boolean eventInheritance)
public EventBusBuilder executorService(java.util.concurrent.ExecutorService executorService)
public EventBusBuilder skipMethodVerificationFor(java.lang.Class<?> clazz)
public EventBusBuilder ignoreGeneratedIndex(boolean ignoreGeneratedIndex)
public EventBusBuilder strictMethodVerification(boolean strictMethodVerification)
public EventBusBuilder addIndex(SubscriberInfoIndex index)
public EventBus installDefaultEventBus()
EventBus.getDefault()
using this builders' values. Must be
done only once before the first usage of the default EventBus.EventBusException
- if there's already a default EventBus instance in placepublic EventBus build()
Available under the Apache License, Version 2.0 - Copyright © 2012-2016 greenrobot.org. All Rights Reserved.