public < T extends Commands > T getCommands ( Class < T > commandInterface ) { LettuceAssert . notNull ( commandInterface , "Redis Command Interface must not be null" ) ; RedisCommandsMetadata metadata = new DefaultRedisCommandsMetadata ( commandInterface ) ; InvocationProxyFactory factory = new InvocationProxyFactory ( ) ; factory . addInterface ( commandInterface ) ; BatchAwareCommandLookupStrategy lookupStrategy = new BatchAwareCommandLookupStrategy ( new CompositeCommandLookupStrategy ( ) , metadata ) ; factory . addInterceptor ( new DefaultMethodInvokingInterceptor ( ) ) ; factory . addInterceptor ( new CommandFactoryExecutorMethodInterceptor ( metadata , lookupStrategy ) ) ; return factory . createProxy ( commandInterface . getClassLoader ( ) ) ; }
Returns a Redis Commands interface instance for the given interface .