
org.redmine.ta.beans.Attachment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redmine-java-api Show documentation
Show all versions of redmine-java-api Show documentation
Free open-source Java API for Redmine and Chiliproject bug/task management systems.
package org.redmine.ta.beans;
import java.util.Date;
/**
* File Attachment for a Redmine issue
* @author Matthias Paul Scholz
*/
public class Attachment implements Identifiable {
private Integer id;
private String fileName;
private long fileSize;
private String contentType;
private String contentURL;
private String description;
private Date createdOn;
private User author;
private String token;
@Override
/**
* @return id. can be NULL for attachments not added to Redmine yet
*/
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
public String getContentURL() {
return contentURL;
}
public void setContentURL(String contentURL) {
this.contentURL = contentURL;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public User getAuthor() {
return author;
}
public void setAuthor(User author) {
this.author = author;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public long getFileSize() {
return fileSize;
}
public void setFileSize(long fileSize) {
this.fileSize = fileSize;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Attachment that = (Attachment) o;
if (fileSize != that.fileSize) return false;
if (author != null ? !author.equals(that.author) : that.author != null) return false;
if (contentType != null ? !contentType.equals(that.contentType) : that.contentType != null) return false;
if (contentURL != null ? !contentURL.equals(that.contentURL) : that.contentURL != null) return false;
if (createdOn != null ? !createdOn.equals(that.createdOn) : that.createdOn != null) return false;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
if (fileName != null ? !fileName.equals(that.fileName) : that.fileName != null) return false;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (token != null ? !token.equals(that.token) : that.token != null) return false;
return true;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (fileName != null ? fileName.hashCode() : 0);
result = 31 * result + (int) (fileSize ^ (fileSize >>> 32));
result = 31 * result + (contentType != null ? contentType.hashCode() : 0);
result = 31 * result + (contentURL != null ? contentURL.hashCode() : 0);
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + (createdOn != null ? createdOn.hashCode() : 0);
result = 31 * result + (author != null ? author.hashCode() : 0);
result = 31 * result + (token != null ? token.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "IssueAttachment{" +
"id=" + id +
", fileName='" + fileName + '\'' +
", fileSize=" + fileSize +
", contentType='" + contentType + '\'' +
", contentURL='" + contentURL + '\'' +
", description='" + description + '\'' +
", createdOn=" + createdOn +
", author=" + author +
", token=" + token +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy