Package com.mewna.catnip.extension
Class AbstractExtension
java.lang.Object
com.mewna.catnip.extension.AbstractExtension
- Since:
- 9/6/18
- Author:
- amy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncatnip()
The catnip instance this extension is registered to.Inject a catnip instance into this extension.<T,
E> io.reactivex.rxjava3.core.Flowable<org.apache.commons.lang3.tuple.Pair<T, E>> flowable
(DoubleEventType<T, E> type) Add a reactive stream handler for events of the given type.<T> io.reactivex.rxjava3.core.Flowable<T>
Add a reactive stream handler for events of the given type.hooks()
Set<MessageConsumer<?>>
name()
The name of this extension.<T,
E> io.reactivex.rxjava3.core.Observable<org.apache.commons.lang3.tuple.Pair<T, E>> observable
(DoubleEventType<T, E> type) Add a reactive stream handler for events of the given type.<T> io.reactivex.rxjava3.core.Observable<T>
observable
(EventType<T> type) Add a reactive stream handler for events of the given type.registerHook
(CatnipHook hook) Register a hook into catnip.unregisterHook
(CatnipHook hook) Unregister a hook from catnip.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.mewna.catnip.extension.Extension
injectOptions, onLoaded, onUnloaded
-
Constructor Details
-
AbstractExtension
-
-
Method Details
-
registerHook
Description copied from interface:Extension
Register a hook into catnip. Hooks are registered by extension, so unloading an extension will also unload all of its hooks.- Specified by:
registerHook
in interfaceExtension
- Parameters:
hook
- The hook to register.- Returns:
- The extension instance.
-
unregisterHook
Description copied from interface:Extension
Unregister a hook from catnip.- Specified by:
unregisterHook
in interfaceExtension
- Parameters:
hook
- The hook to unregister.- Returns:
- The extension instance.
-
hooks
-
observable
Description copied from interface:Extension
Add a reactive stream handler for events of the given type. Can be disposed of withObservable.unsubscribeOn(Scheduler)
. Thescheduler
argument can be created withCatnip.rxScheduler()
.This method automatically subscribes on
Catnip.rxScheduler()
.- Specified by:
observable
in interfaceExtension
- Type Parameters:
T
- The object type of the event being streamed.- Parameters:
type
- The type of event to stream.- Returns:
- The observable.
-
flowable
Description copied from interface:Extension
Add a reactive stream handler for events of the given type. Can be disposed of withFlowable.unsubscribeOn(Scheduler)
. Thescheduler
argument can be created withCatnip.rxScheduler()
.This method automatically subscribes on
Catnip.rxScheduler()
. -
observable
public <T,E> io.reactivex.rxjava3.core.Observable<org.apache.commons.lang3.tuple.Pair<T,E>> observable(@Nonnull DoubleEventType<T, E> type) Description copied from interface:Extension
Add a reactive stream handler for events of the given type. Can be disposed of withObservable.unsubscribeOn(Scheduler)
. Thescheduler
argument can be created withCatnip.rxScheduler()
.This method automatically subscribes on
Catnip.rxScheduler()
.- Specified by:
observable
in interfaceExtension
- Type Parameters:
T
- The object type of the event being streamed.E
- The object type of the event being streamed.- Parameters:
type
- The type of event to stream.- Returns:
- The observable.
-
flowable
public <T,E> io.reactivex.rxjava3.core.Flowable<org.apache.commons.lang3.tuple.Pair<T,E>> flowable(@Nonnull DoubleEventType<T, E> type) Description copied from interface:Extension
Add a reactive stream handler for events of the given type. Can be disposed of withFlowable.unsubscribeOn(Scheduler)
. Thescheduler
argument can be created withCatnip.rxScheduler()
.This method automatically subscribes on
Catnip.rxScheduler()
. -
name
Description copied from interface:Extension
The name of this extension. Note that an extension's name is NOT guaranteed unique, and so your code should NOT rely on this for uniqueness! -
listeners
-
catnip
Description copied from interface:Extension
The catnip instance this extension is registered to. This will not benull
, as a proper extension manager implementation should inject the current catnip instance BEFORE deploying the extension. -
catnip
Description copied from interface:Extension
Inject a catnip instance into this extension. This should be the same as the catnip version that is deploying this extension, and must not benull
. A proper extension manager implementation will call this method to inject a catnip instance BEFORE deploying the extension, ie.Extension.onLoaded()
will be called AFTER this method.
-