private Function<? super ServiceInstance<?>, @Nullable Endpoint> converter() {
        if (converter != null) {
            return converter;
        }
        return instance -> {
            if (!instance.isEnabled()) {
                return null;
            }
            if (instanceId != null && !instanceId.equals(instance.getId())) {
                return null;
            }
            if (useSsl != null && useSsl && instance.getSslPort() != null) {
                return Endpoint.of(instance.getAddress(), instance.getSslPort());
            }

            if (instance.getPort() != null) {
                return Endpoint.of(instance.getAddress(), instance.getPort());
            }
            return Endpoint.of(instance.getAddress());
        };
    }
Sets the specified converter to convert a {@link ServiceInstance} into an {@link Endpoint}.
If you don't want to connect to the service, you can simply return {@code null} in the converter.
zookeeper3/src/main/java/com/linecorp/armeria/client/zookeeper/CuratorDiscoverySpecBuilder.java