public interface Command
Each aggregate has an interface that extends Command and is the base interface for that aggregate's commands. For example:
public interface AccountCommand extends Command {
}
and
public class DebitAccountCommand implements AccountCommand {
private final BigDecimal amount;
private final String transactionId;
public DebitAccountCommand(BigDecimal amount, String transactionId) {
this.amount = amount;
this.transactionId = transactionId;
}
public BigDecimal getAmount() {
return amount;
}
public String getTransactionId() {
return transactionId;
}
}