Home / File/ DefaultHttpResponse.java — netty Source File

DefaultHttpResponse.java — netty Source File

Architecture documentation for DefaultHttpResponse.java, a java file in the netty codebase.

Entity Profile

Relationship Graph

Source Code

/*
 * Copyright 2012 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.handler.codec.http;

import io.netty.util.internal.ObjectUtil;

import static io.netty.handler.codec.http.DefaultHttpHeadersFactory.headersFactory;
import static io.netty.util.internal.ObjectUtil.checkNotNull;

/**
 * The default {@link HttpResponse} implementation.
 */
public class DefaultHttpResponse extends DefaultHttpMessage implements HttpResponse {

    private HttpResponseStatus status;

    /**
     * Creates a new instance.
     *
     * @param version the HTTP version of this response
     * @param status  the status of this response
     */
    public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status) {
        this(version, status, headersFactory());
    }

    /**
     * Creates a new instance.
     *
     * @param version           the HTTP version of this response
     * @param status            the status of this response
     * @param validateHeaders   validate the header names and values when adding them to the {@link HttpHeaders}
     * @deprecated Use the {@link #DefaultHttpResponse(HttpVersion, HttpResponseStatus, HttpHeadersFactory)} constructor
     * instead.
     */
    @Deprecated
    public DefaultHttpResponse(HttpVersion version, HttpResponseStatus status, boolean validateHeaders) {
        this(version, status, headersFactory().withValidation(validateHeaders));
    }

    /**
     * Creates a new instance.
     *
     * @param version           the HTTP version of this response
     * @param status            the status of this response
     * @param validateHeaders   validate the header names and values when adding them to the {@link HttpHeaders}
     * @param singleFieldHeaders {@code true} to check and enforce that headers with the same name are appended
// ... (86 more lines)

Subdomains

Frequently Asked Questions

What does DefaultHttpResponse.java do?
DefaultHttpResponse.java is a source file in the netty codebase, written in java. It belongs to the ProtocolCodecs domain, HTTP subdomain.
Where is DefaultHttpResponse.java in the architecture?
DefaultHttpResponse.java is located at codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpResponse.java (domain: ProtocolCodecs, subdomain: HTTP, directory: codec-http/src/main/java/io/netty/handler/codec/http).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free