HandlerMap

public final class HandlerMap<M extends MessageClass<?>, R extends MessageClass<?>, H extends HandlerMethod<? extends Object, M, ? extends Object, R>> implements Serializable

Provides mapping from a class of messages to methods which handle such messages.

Parameters

<M>

the type of messages

<R>

the type of message classes produced by handler methods

<H>

the type of handler methods

Functions

Link copied to clipboard
public boolean containsClass(M messageClass)
Returns true if the handler map contains a method that handles the passed class of messages, false otherwise.
Link copied to clipboard
public static HandlerMap<M, P, H> create<M extends MessageClass<?>, P extends MessageClass<?>, H extends HandlerMethod<? extends Object, M, ? extends Object, P>>(Class<? extends Object> declaringClass, MethodSignature<H, ? extends Object> signature)
Creates a map of methods found in the passed class.
Link copied to clipboard
public H handlerOf(M messageClass)
Obtains a single handler method for messages of the given class.
public H handlerOf(M messageClass, MessageClass<?> originClass)
Obtains a single handler method for messages of the given class and with the given origin.
Link copied to clipboard
public ImmutableSet<H> handlersOf(M messageClass)
Obtains methods for handling messages of the given class.
public ImmutableSet<H> handlersOf(M messageClass, MessageClass<?> originClass)
Obtains methods for handling messages of the given class and with the given origin.
Link copied to clipboard
public ImmutableSet<M> messageClasses()
Obtains classes of messages for which handlers are stored in this map.
public ImmutableSet<M> messageClasses(Predicate<? extends Object> predicate)
Obtains classes of messages which handlers satisfy the passed predicate.
Link copied to clipboard
public ImmutableCollection<H> methods()
Obtains handler methods matching the passed criteria.
Link copied to clipboard
public ImmutableSet<R> producedTypes()
Obtains the classes of messages produced by the handler methods in this map.