All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.joekerouac.common.tools.net.http.config.IHttp1config Maven / Gradle / Ivy

The newest version!
// Generated by delombok at Fri Mar 14 11:41:38 CST 2025
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
 * file distributed with this work for additional information regarding copyright ownership. The ASF 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
 *
 * http://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 com.github.joekerouac.common.tools.net.http.config;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * @since 1.0.0
 * @author JoeKerouac
 * @date 2022-10-14 14:37:00
 */
public class IHttp1config {
    /**
     * 默认缓冲区大小,单位byte
     */
    private static final int DEFAULT_BUFFER_SIZE = 1024 * 8;
    /**
     * http session缓冲区大小,socket的数据会先读取到该缓冲区,然后供外部读取,{@link org.apache.hc.core5.http.io.SessionInputBuffer
     * SessionInputBuffer}和{@link org.apache.hc.core5.http.io.SessionOutputBuffer SessionOutputBuffer}中会使用该参数,不能小于
     * 0,小于等于0时会使用默认值8K
     */
    @Min(512)
    @Max(1024 * 1024)
    private int httpSessionBufferSize = DEFAULT_BUFFER_SIZE;
    /**
     * {@link org.apache.hc.core5.http.io.SessionOutputBuffer SessionOutputBuffer}中会使用,当写出数据小于该值时会先存储到缓冲区,
     * 如果写出数据大于该大小时则会直接写出到socket,如果该值小于等于0则会使用{@link #httpSessionBufferSize}
     */
    private int httpChunkSizeHint = -1;
    /**
     * http单行最大长度,小于等于0时不限制
     */
    private int httpMaxLineLength = -1;
    /**
     * 最大header数量,小于等于0时不限制
     */
    private int httpMaxHeaderCount = -1;

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public IHttp1config() {
    }

    /**
     * http session缓冲区大小,socket的数据会先读取到该缓冲区,然后供外部读取,{@link org.apache.hc.core5.http.io.SessionInputBuffer
     * SessionInputBuffer}和{@link org.apache.hc.core5.http.io.SessionOutputBuffer SessionOutputBuffer}中会使用该参数,不能小于
     * 0,小于等于0时会使用默认值8K
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int getHttpSessionBufferSize() {
        return this.httpSessionBufferSize;
    }

    /**
     * {@link org.apache.hc.core5.http.io.SessionOutputBuffer SessionOutputBuffer}中会使用,当写出数据小于该值时会先存储到缓冲区,
     * 如果写出数据大于该大小时则会直接写出到socket,如果该值小于等于0则会使用{@link #httpSessionBufferSize}
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int getHttpChunkSizeHint() {
        return this.httpChunkSizeHint;
    }

    /**
     * http单行最大长度,小于等于0时不限制
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int getHttpMaxLineLength() {
        return this.httpMaxLineLength;
    }

    /**
     * 最大header数量,小于等于0时不限制
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int getHttpMaxHeaderCount() {
        return this.httpMaxHeaderCount;
    }

    /**
     * http session缓冲区大小,socket的数据会先读取到该缓冲区,然后供外部读取,{@link org.apache.hc.core5.http.io.SessionInputBuffer
     * SessionInputBuffer}和{@link org.apache.hc.core5.http.io.SessionOutputBuffer SessionOutputBuffer}中会使用该参数,不能小于
     * 0,小于等于0时会使用默认值8K
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setHttpSessionBufferSize(final int httpSessionBufferSize) {
        this.httpSessionBufferSize = httpSessionBufferSize;
    }

    /**
     * {@link org.apache.hc.core5.http.io.SessionOutputBuffer SessionOutputBuffer}中会使用,当写出数据小于该值时会先存储到缓冲区,
     * 如果写出数据大于该大小时则会直接写出到socket,如果该值小于等于0则会使用{@link #httpSessionBufferSize}
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setHttpChunkSizeHint(final int httpChunkSizeHint) {
        this.httpChunkSizeHint = httpChunkSizeHint;
    }

    /**
     * http单行最大长度,小于等于0时不限制
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setHttpMaxLineLength(final int httpMaxLineLength) {
        this.httpMaxLineLength = httpMaxLineLength;
    }

    /**
     * 最大header数量,小于等于0时不限制
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setHttpMaxHeaderCount(final int httpMaxHeaderCount) {
        this.httpMaxHeaderCount = httpMaxHeaderCount;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof IHttp1config)) return false;
        final IHttp1config other = (IHttp1config) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (this.getHttpSessionBufferSize() != other.getHttpSessionBufferSize()) return false;
        if (this.getHttpChunkSizeHint() != other.getHttpChunkSizeHint()) return false;
        if (this.getHttpMaxLineLength() != other.getHttpMaxLineLength()) return false;
        if (this.getHttpMaxHeaderCount() != other.getHttpMaxHeaderCount()) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof IHttp1config;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getHttpSessionBufferSize();
        result = result * PRIME + this.getHttpChunkSizeHint();
        result = result * PRIME + this.getHttpMaxLineLength();
        result = result * PRIME + this.getHttpMaxHeaderCount();
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "IHttp1config(httpSessionBufferSize=" + this.getHttpSessionBufferSize() + ", httpChunkSizeHint=" + this.getHttpChunkSizeHint() + ", httpMaxLineLength=" + this.getHttpMaxLineLength() + ", httpMaxHeaderCount=" + this.getHttpMaxHeaderCount() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy