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

com.ardoq.model.Attachment Maven / Gradle / Ivy

package com.ardoq.model;

import com.google.gson.annotations.SerializedName;

import java.util.Date;

/**
 * Represents an attachment stored on a workspace.
 */
public class Attachment {
    @SerializedName("_id")
    private String id;
    private Date created;
    @SerializedName("created-by")
    private String createdBy;
    @SerializedName("last-updated")
    private Date lastUpdated;
    @SerializedName("content-type")
    private String contentType;
    private String filename;
    private String uri;
    private Long size;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Attachment that = (Attachment) o;

        if (contentType != null ? !contentType.equals(that.contentType) : that.contentType != null) return false;
        if (created != null ? !created.equals(that.created) : that.created != null) return false;
        if (createdBy != null ? !createdBy.equals(that.createdBy) : that.createdBy != 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 (lastUpdated != null ? !lastUpdated.equals(that.lastUpdated) : that.lastUpdated != null) return false;
        if (size != null ? !size.equals(that.size) : that.size != null) return false;
        if (uri != null ? !uri.equals(that.uri) : that.uri != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (created != null ? created.hashCode() : 0);
        result = 31 * result + (createdBy != null ? createdBy.hashCode() : 0);
        result = 31 * result + (lastUpdated != null ? lastUpdated.hashCode() : 0);
        result = 31 * result + (contentType != null ? contentType.hashCode() : 0);
        result = 31 * result + (filename != null ? filename.hashCode() : 0);
        result = 31 * result + (uri != null ? uri.hashCode() : 0);
        result = 31 * result + (size != null ? size.hashCode() : 0);
        return result;
    }

    public String getId() {
        return id;
    }

    public Date getCreated() {
        return created;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public Date getLastUpdated() {
        return lastUpdated;
    }

    public String getContentType() {
        return contentType;
    }

    public String getFilename() {
        return filename;
    }

    public String getUri() {
        return uri;
    }

    public Long getSize() {
        return size;
    }

    @Override
    public String toString() {
        return "Attachment{" +
                "id='" + id + '\'' +
                ", created=" + created +
                ", createdBy='" + createdBy + '\'' +
                ", lastUpdated=" + lastUpdated +
                ", contentType='" + contentType + '\'' +
                ", filename='" + filename + '\'' +
                ", uri='" + uri + '\'' +
                ", size=" + size +
                '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy