@Override public Object identifier() { return wrappedAggregate.identifier(); }
/** * Resolves the value to return when the given {@code command} has created the given {@code aggregate}. * This implementation returns the identifier of the created aggregate. * <p> * This method may be overridden to change the return value of this Command Handler * * @param command The command being executed * @param createdAggregate The aggregate that has been created as a result of the command * @return The value to report as result of the command */ protected Object resolveReturnValue(CommandMessage<?> command, Aggregate<T> createdAggregate) { return createdAggregate.identifier(); }
/** * Get the unique identifier of this aggregate, represented as a String. * * @return The aggregate's identifier as a String */ default String identifierAsString() { return Objects.toString(identifier(), null); }
@Override public Object identifier() { return wrappedAggregate.identifier(); }
/** * Resolves the value to return when the given {@code command} has created the given {@code aggregate}. * This implementation returns the identifier of the created aggregate. * <p> * This method may be overridden to change the return value of this Command Handler * * @param command The command being executed * @param createdAggregate The aggregate that has been created as a result of the command * @return The value to report as result of the command */ protected Object resolveReturnValue(CommandMessage<?> command, Aggregate<T> createdAggregate) { return createdAggregate.identifier(); }
/** * Get the unique identifier of this aggregate, represented as a String. * * @return The aggregate's identifier as a String */ default String identifierAsString() { return Objects.toString(identifier(), null); }