org.keridwen.core.messaging.internal
Class CommandFactory

java.lang.Object
  extended by org.keridwen.core.messaging.internal.CommandFactory

public final class CommandFactory
extends Object


Method Summary
static
<ReturnType extends Serializable,IntermediateMessageType extends Serializable,MessageType extends Serializable>
Command<ReturnType,MessageType>
compose(Command<IntermediateMessageType,MessageType> command1, Command<ReturnType,IntermediateMessageType> command2)
          Return the composition of two Commands.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compose

public static <ReturnType extends Serializable,IntermediateMessageType extends Serializable,MessageType extends Serializable> Command<ReturnType,MessageType> compose(Command<IntermediateMessageType,MessageType> command1,
                                                                                                                                                                      Command<ReturnType,IntermediateMessageType> command2)
Return the composition of two Commands. For command2: IntermediateMessageType->ReturnType and command1: MessageType->IntermediateMessageType, composition is defined as the function h such that h(a) == command2(command1(a)) for each a.

Type Parameters:
ReturnType - the return type of the composed function.
IntermediateMessageType - the return type of the g function, that is the message type of the f function
MessageType - the message type of the composed function, that is the message type of the g function
Parameters:
command1 - the first command to compose
command2 - the second command to compose
Returns:
the composed command


Copyright © 2010-2013 Artenum. All Rights Reserved.