create

public Command create(CommandMessage message)

Creates a new Command with the given message.

Return

new command instance

Parameters

message

the command message

Throws

ValidationException

if the passed message does not satisfy the constraints, set for it in its Protobuf definition


public Command create(CommandMessage message, int targetVersion)

Creates a new Command with the passed message and target entity version.

The targetVersion parameter defines the version of the entity which handles the resulting command. Note that the framework performs no validation of the target version before a command is handled. Instead users themselves can perform validation.

Return

new command instance

Parameters

message

the command message

targetVersion

the version of the entity for which this command is intended

Throws

ValidationException

if the passed message does not satisfy the constraints set for it in its Protobuf definition