Repository: netty/netty
File: resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverBuilder.java (Java)

Code before:
    public DnsNameResolverBuilder datagramChannelFactory(
            ChannelFactory<? extends DatagramChannel> datagramChannelFactory) {
        this.datagramChannelFactory = datagramChannelFactory;
        return this;
    }

    /**
     * Sets the {@link ChannelFactory} as a {@link ReflectiveChannelFactory} of this type.
     * Use as an alternative to {@link #channelFactory(ChannelFactory)}.
     * If <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> should be supported as well it is required
     * to call the {@link #socketChannelFactory(ChannelFactory) or {@link #socketChannelType(Class)}} method.
     *
     * @param channelType the type
     * @return {@code this}
     * @deprecated use {@link #datagramChannelType(Class)}
     */
    @Deprecated
    public DnsNameResolverBuilder channelType(Class<? extends DatagramChannel> channelType) {
        return datagramChannelFactory(new ReflectiveChannelFactory<DatagramChannel>(channelType));
    }

    /**
     * Sets the {@link ChannelFactory} as a {@link ReflectiveChannelFactory} of this type.
     * Use as an alternative to {@link #datagramChannelFactory(ChannelFactory)} (ChannelFactory)}.
     * If <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> should be supported as well it is required
     * to call the {@link #socketChannelFactory(ChannelFactory) or {@link #socketChannelType(Class)}} method.
     *
     * @param channelType the type
     * @return {@code this}
     */
    public DnsNameResolverBuilder datagramChannelType(Class<? extends DatagramChannel> channelType) {
        return datagramChannelFactory(new ReflectiveChannelFactory<DatagramChannel>(channelType));
    }

    /**
     * Sets the {@link ChannelFactory} that will create a {@link SocketChannel} for
     * <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> if needed.
     *
     * TCP fallback is <strong>not</strong> enabled by default and must be enabled by providing a non-null
     * {@link ChannelFactory} for this method.
     *
     * @param channelFactory the {@link ChannelFactory} or {@code null}
     *                       if <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> should not be supported.
     *                       By default, TCP fallback is not enabled.
     * @return {@code this}
     */
    public DnsNameResolverBuilder socketChannelFactory(ChannelFactory<? extends SocketChannel> channelFactory) {
        return socketChannelFactory(channelFactory, false);
    }

    /**

Review comment (suggestion):
Consider adding `@see ##datagramChannelFactory(ChannelFactory)` after `@return`

Code after:
    /**
     * Sets the {@link ChannelFactory} as a {@link ReflectiveChannelFactory} of this type.
     * Use as an alternative to {@link #channelFactory(ChannelFactory)}.
     * <p>
     * If <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> should be supported as well it is required
     * to call the {@link #socketChannelFactory(ChannelFactory) or {@link #socketChannelType(Class)}} method.
     *
     * @param channelType the type
     * @return {@code this}
     * @deprecated use {@link #datagramChannelType(Class)}
     */
    @Deprecated
    public DnsNameResolverBuilder channelType(Class<? extends DatagramChannel> channelType) {
        return datagramChannelFactory(new ReflectiveChannelFactory<DatagramChannel>(channelType));
    }

    /**
     * Sets the {@link ChannelFactory} as a {@link ReflectiveChannelFactory} of this type.
     * Use as an alternative to {@link #datagramChannelFactory(ChannelFactory)}.
     * <p>
     * If <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> should be supported as well it is required
     * to call the {@link #socketChannelFactory(ChannelFactory) or {@link #socketChannelType(Class)}} method.
     *
     * @param channelType the type
     * @return {@code this}
     */
    public DnsNameResolverBuilder datagramChannelType(Class<? extends DatagramChannel> channelType) {
        return datagramChannelFactory(new ReflectiveChannelFactory<DatagramChannel>(channelType));
    }

    /**
     * Sets the {@link ChannelFactory} that will create a {@link SocketChannel} for
     * <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> if needed.
     * <p>
     * TCP fallback is <strong>not</strong> enabled by default and must be enabled by providing a non-null
     * {@link ChannelFactory} for this method.
     *
     * @param channelFactory the {@link ChannelFactory} or {@code null}
     *                       if <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> should not be supported.
     *                       By default, TCP fallback is not enabled.
     * @return {@code this}
     */
    public DnsNameResolverBuilder socketChannelFactory(ChannelFactory<? extends SocketChannel> channelFactory) {
        return socketChannelFactory(channelFactory, false);
    }

    /**
     * Sets the {@link ChannelFactory} as a {@link ReflectiveChannelFactory} of this type for
     * <a href="https://tools.ietf.org/html/rfc7766">TCP fallback</a> if needed.
     * Use as an alternative to {@link #socketChannelFactory(ChannelFactory)}.
     * <p>