public static CommandMethodMapping forMethod(Method method, String aggregateType) { checkNotNull(method, "method must not be null"); final VersionedName commandName = getCommandName(method); ParameterArgs parameterArgs = ParameterArgs.forMethod(method, 2); TupleSchema schema = parameterArgs.getTupleSchema(CommandType.of(aggregateType, commandName).toString()); TupleKey[] tupleKeys = parameterArgs.getTupleKeys(schema); return new CommandMethodMapping( aggregateType, commandName, schema, tupleKeys, method.getGenericReturnType()); }