class Builder {

            private int count = DEFAULT_COUNT;

            private boolean enabled = DEFAULT_SO_KEEPALIVE;

            private Duration idle = DEFAULT_IDLE;

            private Duration interval = DEFAULT_INTERVAL;

            private Builder() {
            }

            /**
             * Set the maximum number of keepalive probes TCP should send before dropping the connection. Defaults to {@code 9}.
             * See also {@link #DEFAULT_COUNT} and {@code TCP_KEEPCNT}.
             *
             * @param count the maximum number of keepalive probes TCP
             * @return {@code this}
             */
            public KeepAliveOptions.Builder count(int count) {

                LettuceAssert.isTrue(count >= 0, "Count must be greater 0");

                this.count = count;
                return this;
            }

            /**
             * Enable TCP keepalive. Defaults to disabled. See {@link #DEFAULT_SO_KEEPALIVE}.
             *
             * @return {@code this}
             * @see java.net.SocketOptions#SO_KEEPALIVE
             */
            public KeepAliveOptions.Builder enable() {
                return enable(true);
            }

            /**
             * Disable TCP keepalive. Defaults to disabled. See {@link #DEFAULT_SO_KEEPALIVE}.
             *
             * @return {@code this}
             * @see java.net.SocketOptions#SO_KEEPALIVE
             */
            public KeepAliveOptions.Builder disable() {
                return enable(false);
            }

            /**
             * Enable TCP keepalive. Defaults to {@code false}. See {@link #DEFAULT_SO_KEEPALIVE}.
             *
             * @param enabled whether to enable TCP keepalive.
             * @return {@code this}
             * @see java.net.SocketOptions#SO_KEEPALIVE
             */
            public KeepAliveOptions.Builder enable(boolean enabled) {

                this.enabled = enabled;
                return this;
            }

            /**
             * The time the connection needs to remain idle before TCP starts sending keepalive probes if keepalive is enabled.
             * Defaults to {@code 2 hours}. See also @link {@link #DEFAULT_IDLE} and {@code TCP_KEEPIDLE}.
             * <p>
             * The time granularity of is seconds.
             *
             * @param idle connection idle time, must be greater {@literal 0}.
             * @return {@code this}
             */
            public KeepAliveOptions.Builder idle(Duration idle) {

                LettuceAssert.notNull(idle, "Idle time must not be null");
                LettuceAssert.isTrue(!idle.isNegative(), "Idle time must not be begative");

                this.idle = idle;
                return this;
            }

            /**
             * The time between individual keepalive probes. Defaults to {@code 75 second}. See also {@link #DEFAULT_INTERVAL}
             * and {@code TCP_KEEPINTVL}.
             * <p>
             * The time granularity of is seconds.
             *
             * @param interval connection interval time, must be greater {@literal 0}
             * @return {@code this}
             */
            public KeepAliveOptions.Builder interval(Duration interval) {<FILL_FUNCTION_BODY>}

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

        }


                LettuceAssert.notNull(interval, "Idle time must not be null");
                LettuceAssert.isTrue(!interval.isNegative(), "Idle time must not be begative");

                this.interval = interval;
                return this;
            
<no_super_class>