class Builder extends ClientOptions.Builder {

        private boolean closeStaleConnections = DEFAULT_CLOSE_STALE_CONNECTIONS;

        private int maxRedirects = DEFAULT_MAX_REDIRECTS;

        private boolean validateClusterNodeMembership = DEFAULT_VALIDATE_CLUSTER_MEMBERSHIP;

        private Predicate<RedisClusterNode> nodeFilter = DEFAULT_NODE_FILTER;

        private ClusterTopologyRefreshOptions topologyRefreshOptions = null;

        protected Builder() {
            readOnlyCommands(DEFAULT_READ_ONLY_COMMANDS);
        }

        @Override
        public Builder autoReconnect(boolean autoReconnect) {
            super.autoReconnect(autoReconnect);
            return this;
        }

        /**
         * @param bufferUsageRatio the buffer usage ratio. Must be between {@code 0} and {@code 2^31-1}, typically a value
         *        between 1 and 10 representing 50% to 90%.
         * @return {@code this}
         * @deprecated since 6.0 in favor of {@link DecodeBufferPolicy}.
         */
        @Override
        @Deprecated
        public Builder bufferUsageRatio(int bufferUsageRatio) {
            super.bufferUsageRatio(bufferUsageRatio);
            return this;
        }

        /**
         *
         * @param cancelCommandsOnReconnectFailure true/false
         * @return
         * @deprecated since 6.2, to be removed with 7.0. This feature is unsafe and may cause protocol offsets if true (i.e.
         *             Redis commands are completed with previous command values).
         */
        @Override
        @Deprecated
        public Builder cancelCommandsOnReconnectFailure(boolean cancelCommandsOnReconnectFailure) {
            super.cancelCommandsOnReconnectFailure(cancelCommandsOnReconnectFailure);
            return this;
        }

        @Override
        public Builder decodeBufferPolicy(DecodeBufferPolicy decodeBufferPolicy) {
            super.decodeBufferPolicy(decodeBufferPolicy);
            return this;
        }

        @Override
        public Builder disconnectedBehavior(DisconnectedBehavior disconnectedBehavior) {
            super.disconnectedBehavior(disconnectedBehavior);
            return this;
        }

        /**
         * Number of maximal cluster redirects ({@literal -MOVED} and {@literal -ASK}) to follow in case a key was moved from
         * one node to another node. Defaults to {@literal 5}. See {@link ClusterClientOptions#DEFAULT_MAX_REDIRECTS}.
         *
         * @param maxRedirects the limit of maximal cluster redirects
         * @return {@code this}
         */
        public Builder maxRedirects(int maxRedirects) {
            this.maxRedirects = maxRedirects;
            return this;
        }

        @Override
        public Builder pingBeforeActivateConnection(boolean pingBeforeActivateConnection) {
            super.pingBeforeActivateConnection(pingBeforeActivateConnection);
            return this;
        }

        @Override
        public Builder protocolVersion(ProtocolVersion protocolVersion) {
            super.protocolVersion(protocolVersion);
            return this;
        }

        @Override
        public Builder suspendReconnectOnProtocolFailure(boolean suspendReconnectOnProtocolFailure) {
            super.suspendReconnectOnProtocolFailure(suspendReconnectOnProtocolFailure);
            return this;
        }

        @Override
        public Builder publishOnScheduler(boolean publishOnScheduler) {
            super.publishOnScheduler(publishOnScheduler);
            return this;
        }

        @Override
        public Builder readOnlyCommands(ReadOnlyCommands.ReadOnlyPredicate readOnlyCommands) {

            super.readOnlyCommands(readOnlyCommands);
            return this;
        }

        @Override
        public Builder requestQueueSize(int requestQueueSize) {
            super.requestQueueSize(requestQueueSize);
            return this;
        }

        @Override
        public Builder scriptCharset(Charset scriptCharset) {
            super.scriptCharset(scriptCharset);
            return this;
        }

        @Override
        public Builder socketOptions(SocketOptions socketOptions) {
            super.socketOptions(socketOptions);
            return this;
        }

        @Override
        public Builder sslOptions(SslOptions sslOptions) {
            super.sslOptions(sslOptions);
            return this;
        }

        @Override
        public Builder timeoutOptions(TimeoutOptions timeoutOptions) {
            super.timeoutOptions(timeoutOptions);
            return this;
        }

        /**
         * Sets the {@link ClusterTopologyRefreshOptions} for detailed control of topology updates.
         *
         * @param topologyRefreshOptions the {@link ClusterTopologyRefreshOptions}
         * @return {@code this}
         */
        public Builder topologyRefreshOptions(ClusterTopologyRefreshOptions topologyRefreshOptions) {
            this.topologyRefreshOptions = topologyRefreshOptions;
            return this;
        }

        /**
         * Validate the cluster node membership before allowing connections to a cluster node. Defaults to {@code true}. See
         * {@link ClusterClientOptions#DEFAULT_VALIDATE_CLUSTER_MEMBERSHIP}.
         *
         * @param validateClusterNodeMembership {@code true} if validation is enabled.
         * @return {@code this}
         */
        public Builder validateClusterNodeMembership(boolean validateClusterNodeMembership) {
            this.validateClusterNodeMembership = validateClusterNodeMembership;
            return this;
        }

        /**
         * Provide a {@link Predicate node filter} to filter cluster nodes from
         * {@link io.lettuce.core.cluster.models.partitions.Partitions}.
         *
         * @param nodeFilter must not be {@code null}.
         * @return {@code this}
         * @since 6.1.6
         */
        public Builder nodeFilter(Predicate<RedisClusterNode> nodeFilter) {

            LettuceAssert.notNull(nodeFilter, "NodeFilter must not be null");
            this.nodeFilter = nodeFilter;
            return this;
        }

        /**
         * Create a new instance of {@link ClusterClientOptions}
         *
         * @return new instance of {@link ClusterClientOptions}
         */
        public ClusterClientOptions build() {
            return new ClusterClientOptions(this);
        }

    }

    /**
     * Returns a builder to create new {@link ClusterClientOptions} whose settings are replicated from the current
     * {@link ClusterClientOptions}.
     *
     * @return a {@link ClusterClientOptions.Builder} to create new {@link ClusterClientOptions} whose settings are replicated
     *         from the current {@link ClusterClientOptions}.
     *
     * @since 5.1
     */
    public ClusterClientOptions.Builder mutate() {<FILL_FUNCTION_BODY>


        Builder builder = new Builder();

        builder.autoReconnect(isAutoReconnect())
                .cancelCommandsOnReconnectFailure(isCancelCommandsOnReconnectFailure())
                .decodeBufferPolicy(getDecodeBufferPolicy())
                .disconnectedBehavior(getDisconnectedBehavior()).maxRedirects(getMaxRedirects())
                .publishOnScheduler(isPublishOnScheduler()).pingBeforeActivateConnection(isPingBeforeActivateConnection())
                .protocolVersion(getConfiguredProtocolVersion()).readOnlyCommands(getReadOnlyCommands())
                .requestQueueSize(getRequestQueueSize())
                .scriptCharset(getScriptCharset()).socketOptions(getSocketOptions()).sslOptions(getSslOptions())
                .suspendReconnectOnProtocolFailure(isSuspendReconnectOnProtocolFailure()).timeoutOptions(getTimeoutOptions())
                .topologyRefreshOptions(getTopologyRefreshOptions())
                .validateClusterNodeMembership(isValidateClusterNodeMembership()).nodeFilter(getNodeFilter());

        return builder;
    
<methods>public static io.lettuce.core.ClientOptions.Builder builder() ,public static io.lettuce.core.ClientOptions copyOf(io.lettuce.core.ClientOptions) ,public static io.lettuce.core.ClientOptions create() ,public int getBufferUsageRatio() ,public io.lettuce.core.protocol.ProtocolVersion getConfiguredProtocolVersion() ,public io.lettuce.core.protocol.DecodeBufferPolicy getDecodeBufferPolicy() ,public io.lettuce.core.ClientOptions.DisconnectedBehavior getDisconnectedBehavior() ,public io.lettuce.core.protocol.ProtocolVersion getProtocolVersion() ,public io.lettuce.core.protocol.ReadOnlyCommands.ReadOnlyPredicate getReadOnlyCommands() ,public int getRequestQueueSize() ,public java.nio.charset.Charset getScriptCharset() ,public io.lettuce.core.SocketOptions getSocketOptions() ,public io.lettuce.core.SslOptions getSslOptions() ,public io.lettuce.core.TimeoutOptions getTimeoutOptions() ,public boolean isAutoReconnect() ,public boolean isCancelCommandsOnReconnectFailure() ,public boolean isPingBeforeActivateConnection() ,public boolean isPublishOnScheduler() ,public boolean isSuspendReconnectOnProtocolFailure() ,public io.lettuce.core.ClientOptions.Builder mutate() <variables>public static final boolean DEFAULT_AUTO_RECONNECT,public static final int DEFAULT_BUFFER_USAGE_RATIO,public static final boolean DEFAULT_CANCEL_CMD_RECONNECT_FAIL,public static final io.lettuce.core.ClientOptions.DisconnectedBehavior DEFAULT_DISCONNECTED_BEHAVIOR,public static final boolean DEFAULT_PING_BEFORE_ACTIVATE_CONNECTION,public static final io.lettuce.core.protocol.ProtocolVersion DEFAULT_PROTOCOL_VERSION,public static final boolean DEFAULT_PUBLISH_ON_SCHEDULER,public static final io.lettuce.core.protocol.ReadOnlyCommands.ReadOnlyPredicate DEFAULT_READ_ONLY_COMMANDS,public static final int DEFAULT_REQUEST_QUEUE_SIZE,public static final java.nio.charset.Charset DEFAULT_SCRIPT_CHARSET,public static final io.lettuce.core.SocketOptions DEFAULT_SOCKET_OPTIONS,public static final io.lettuce.core.SslOptions DEFAULT_SSL_OPTIONS,public static final boolean DEFAULT_SUSPEND_RECONNECT_PROTO_FAIL,public static final io.lettuce.core.TimeoutOptions DEFAULT_TIMEOUT_OPTIONS,private final non-sealed boolean autoReconnect,private final non-sealed boolean cancelCommandsOnReconnectFailure,private final non-sealed io.lettuce.core.protocol.DecodeBufferPolicy decodeBufferPolicy,private final non-sealed io.lettuce.core.ClientOptions.DisconnectedBehavior disconnectedBehavior,private final non-sealed boolean pingBeforeActivateConnection,private final non-sealed io.lettuce.core.protocol.ProtocolVersion protocolVersion,private final non-sealed boolean publishOnScheduler,private final non-sealed io.lettuce.core.protocol.ReadOnlyCommands.ReadOnlyPredicate readOnlyCommands,private final non-sealed int requestQueueSize,private final non-sealed java.nio.charset.Charset scriptCharset,private final non-sealed io.lettuce.core.SocketOptions socketOptions,private final non-sealed io.lettuce.core.SslOptions sslOptions,private final non-sealed boolean suspendReconnectOnProtocolFailure,private final non-sealed io.lettuce.core.TimeoutOptions timeoutOptions