Skip to content

Conversation

jruaux
Copy link
Contributor

@jruaux jruaux commented Sep 15, 2025

Add a RedisCodec<K,V> getCodec() method like StatefulRedisConnectionImpl does

@jruaux jruaux requested a review from Copilot September 15, 2025 17:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a getCodec() method to StatefulRedisClusterConnectionImpl to provide access to the underlying Redis codec, bringing consistency with StatefulRedisConnectionImpl which already has this method.

  • Add public getCodec() method that returns the RedisCodec<K,V> instance

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

this.sync = newRedisAdvancedClusterCommandsImpl();
this.reactive = newRedisAdvancedClusterReactiveCommandsImpl();
}

Copy link
Preview

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new public method getCodec() lacks documentation. Add a Javadoc comment explaining what the method returns and its purpose, similar to the documentation pattern used in the rest of the codebase.

Suggested change
/**
* Returns the {@link RedisCodec} used to encode and decode keys and values for this connection.
*
* @return the codec used by this connection.
*/

Copilot uses AI. Check for mistakes.

@jruaux jruaux requested a review from tishun September 15, 2025 17:33
@tishun
Copy link
Collaborator

tishun commented Sep 19, 2025

Hey @jruaux ,

can you give me some context to why we need this?

Overall I am not opposed, but I'd rather expose it as part of the contract, as right now it requires casting which is not a very good pattern to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants