I
- the type of target entity IDspublic final class DefaultCommandRoute<I> extends java.lang.Object implements CommandRoute<I,io.spine.base.CommandMessage>
Modifier and Type | Method and Description |
---|---|
I |
apply(io.spine.base.CommandMessage message,
io.spine.core.CommandContext ignored)
Obtains entity ID(s) from the passed message and its context.
|
static boolean |
exists(io.spine.base.CommandMessage commandMessage)
Verifies of the passed command message potentially has a field with an entity ID.
|
static <I> DefaultCommandRoute<I> |
newInstance(java.lang.Class<I> idClass)
Creates a new instance.
|
public static <I> DefaultCommandRoute<I> newInstance(java.lang.Class<I> idClass)
idClass
- the class of identifiers used for the routingpublic I apply(io.spine.base.CommandMessage message, io.spine.core.CommandContext ignored) throws io.spine.protobuf.MessageFieldException
Route
apply
in interface Route<io.spine.base.CommandMessage,io.spine.core.CommandContext,I>
apply
in interface java.util.function.BiFunction<io.spine.base.CommandMessage,io.spine.core.CommandContext,I>
message
- the event or a command messageignored
- the context of the messageio.spine.protobuf.MessageFieldException
public static boolean exists(io.spine.base.CommandMessage commandMessage)