
com.github.joekerouac.common.tools.net.http.request.UploadFile 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.request;
import java.io.InputStream;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.github.joekerouac.common.tools.net.http.ContentType;
/**
* 上传文件
*
* @author JoeKerouac
* @date 2022-10-14 14:37:00
* @since 1.0.0
*/
public class UploadFile {
/**
* 文件输入流
*/
@NotNull
private InputStream file;
/**
* form表单名
*/
@NotBlank
private String name;
/**
* 文件名
*/
@NotBlank
private String fileName;
/**
* 文件content type,例如image/png、application/octet-stream,可以参考{@link ContentType}
*/
@NotBlank
private String contentType;
/**
* 编码字符集,如果为空则使用当前系统默认编码字符集
*/
private String charset;
@java.lang.SuppressWarnings("all")
@lombok.Generated
public UploadFile() {
}
/**
* 文件输入流
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public InputStream getFile() {
return this.file;
}
/**
* form表单名
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getName() {
return this.name;
}
/**
* 文件名
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getFileName() {
return this.fileName;
}
/**
* 文件content type,例如image/png、application/octet-stream,可以参考{@link ContentType}
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getContentType() {
return this.contentType;
}
/**
* 编码字符集,如果为空则使用当前系统默认编码字符集
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getCharset() {
return this.charset;
}
/**
* 文件输入流
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setFile(final InputStream file) {
this.file = file;
}
/**
* form表单名
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setName(final String name) {
this.name = name;
}
/**
* 文件名
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setFileName(final String fileName) {
this.fileName = fileName;
}
/**
* 文件content type,例如image/png、application/octet-stream,可以参考{@link ContentType}
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setContentType(final String contentType) {
this.contentType = contentType;
}
/**
* 编码字符集,如果为空则使用当前系统默认编码字符集
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setCharset(final String charset) {
this.charset = charset;
}
@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 UploadFile)) return false;
final UploadFile other = (UploadFile) o;
if (!other.canEqual((java.lang.Object) this)) return false;
final java.lang.Object this$file = this.getFile();
final java.lang.Object other$file = other.getFile();
if (this$file == null ? other$file != null : !this$file.equals(other$file)) return false;
final java.lang.Object this$name = this.getName();
final java.lang.Object other$name = other.getName();
if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
final java.lang.Object this$fileName = this.getFileName();
final java.lang.Object other$fileName = other.getFileName();
if (this$fileName == null ? other$fileName != null : !this$fileName.equals(other$fileName)) return false;
final java.lang.Object this$contentType = this.getContentType();
final java.lang.Object other$contentType = other.getContentType();
if (this$contentType == null ? other$contentType != null : !this$contentType.equals(other$contentType)) return false;
final java.lang.Object this$charset = this.getCharset();
final java.lang.Object other$charset = other.getCharset();
if (this$charset == null ? other$charset != null : !this$charset.equals(other$charset)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof UploadFile;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final java.lang.Object $file = this.getFile();
result = result * PRIME + ($file == null ? 43 : $file.hashCode());
final java.lang.Object $name = this.getName();
result = result * PRIME + ($name == null ? 43 : $name.hashCode());
final java.lang.Object $fileName = this.getFileName();
result = result * PRIME + ($fileName == null ? 43 : $fileName.hashCode());
final java.lang.Object $contentType = this.getContentType();
result = result * PRIME + ($contentType == null ? 43 : $contentType.hashCode());
final java.lang.Object $charset = this.getCharset();
result = result * PRIME + ($charset == null ? 43 : $charset.hashCode());
return result;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public java.lang.String toString() {
return "UploadFile(file=" + this.getFile() + ", name=" + this.getName() + ", fileName=" + this.getFileName() + ", contentType=" + this.getContentType() + ", charset=" + this.getCharset() + ")";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy