Search in sources :

Example 1 with MethodParametersAccessor

use of io.lettuce.core.dynamic.parameter.MethodParametersAccessor in project lettuce-core by lettuce-io.

the class CommandSegmentCommandFactory method createCommand.

@Override
public RedisCommand<Object, Object, Object> createCommand(Object[] parameters) {
    MethodParametersAccessor parametersAccessor = new CodecAwareMethodParametersAccessor(new DefaultMethodParametersAccessor(commandMethod.getParameters(), parameters), typeContext);
    CommandArgs<Object, Object> args = new CommandArgs<>(redisCodec);
    CommandOutput<Object, Object, ?> output = outputFactory.create(redisCodec);
    Command<Object, Object, ?> command = new Command<>(this.segments.getCommandType(), output, args);
    parameterBinder.bind(args, redisCodec, segments, parametersAccessor);
    return (Command) command;
}
Also used : MethodParametersAccessor(io.lettuce.core.dynamic.parameter.MethodParametersAccessor) CommandArgs(io.lettuce.core.protocol.CommandArgs) RedisCommand(io.lettuce.core.protocol.RedisCommand) Command(io.lettuce.core.protocol.Command)

Aggregations

MethodParametersAccessor (io.lettuce.core.dynamic.parameter.MethodParametersAccessor)1 Command (io.lettuce.core.protocol.Command)1 CommandArgs (io.lettuce.core.protocol.CommandArgs)1 RedisCommand (io.lettuce.core.protocol.RedisCommand)1