public final class RxJavaProtocolValidator extends Object
setOnViolationHandler(PlainConsumer)
,
enable()
Modifier and Type | Method and Description |
---|---|
static void |
disable()
Disables the validation hooks be resetting the assembly hooks
to none.
|
static void |
enable()
Enable the protocol violation hooks.
|
static SavedHooks |
enableAndChain()
Enable the protocol violation hooks by chaining it
before any existing hook.
|
static @Nullable PlainConsumer<ProtocolNonConformanceException> |
getOnViolationHandler()
Returns the current custom violation callback handler.
|
static boolean |
isEnabled()
Returns true if the validation hooks have been installed.
|
static void |
setOnViolationHandler(@Nullable PlainConsumer<ProtocolNonConformanceException> handler)
Set a custom violation callback handler.
|
public static void enable()
enableAndChain()
,
disable()
public static SavedHooks enableAndChain()
enable()
public static void disable()
public static boolean isEnabled()
public static void setOnViolationHandler(@Nullable @Nullable PlainConsumer<ProtocolNonConformanceException> handler)
Call this method before enabling the validation hooks via enable()
.
Calling with null
restores the default handler which forwards the exception
to the global RxJavaPlugins.onError(Throwable)
handler.
handler
- the handler that will receive the ProtocolNonConformanceException
violation exceptions@Nullable public static @Nullable PlainConsumer<ProtocolNonConformanceException> getOnViolationHandler()