class HttpServerExchangeMessage implements HttpExchangeMessage {


    AtomicReference<Boolean> responded = new AtomicReference<>(false);

    MultiPart multiPart;

    public HttpServerExchangeMessage(HttpExchange exchange,
                                     ByteBuf payload,
                                     MultiPart multiPart) {
        this.exchange = exchange;
        this.payload = payload;
        this.multiPart = multiPart;
    }

    private final HttpExchange exchange;
    private final ByteBuf payload;

    @Nonnull
    @Override
    public Mono<Void> response(@Nonnull HttpResponseMessage message) {<FILL_FUNCTION_BODY>}

    @Override
    public Optional<MultiPart> multiPart() {
        return Optional
            .ofNullable(multiPart)
            .filter(part -> part.getParts().size() > 0);
    }

    @Nonnull
    @Override
    public String getUrl() {
        return exchange.request().getUrl();
    }

    @Nonnull
    @Override
    public HttpMethod getMethod() {
        return exchange.request().getMethod();
    }

    @Nullable
    @Override
    public MediaType getContentType() {
        return exchange.request().getContentType();
    }

    @Nonnull
    @Override
    public List<Header> getHeaders() {
        return exchange.request().getHeaders();
    }

    @Nullable
    @Override
    public Map<String, String> getQueryParameters() {
        return exchange.request().getQueryParameters();
    }

    @Nonnull
    @Override
    public ByteBuf getPayload() {
        return payload;
    }

    @Override
    public String toString() {
        return print();
    }
}

        return Mono
            .defer(() -> {
                if (!responded.getAndSet(true) && !exchange.isClosed()) {
                    if (log.isDebugEnabled()) {
                        log.debug("响应HTTP请求:\n{}", message.print());
                    }
                    return exchange.response(message);
                }
                return Mono.empty();
            });
    
<no_super_class>