package util;

import java.io.Serializable;
import java.util.UUID;

public class AttachmentWrapper implements Serializable {
    private String description;
    private Integer attachmentId;
    private Integer entityInstanceId;
    private String entityType;
    private String filename;
    private String tntityType;
    private byte[] thumbnail;
    private String viewerUrl;
    private String action;

    private String uuid;
    private String sessionInfoXml;
    private boolean clonedAttachment;
    private String contentType;

    public AttachmentWrapper () {


        uuid = System.currentTimeMillis() + "_" + UUID.randomUUID().toString();;
    }

    public String getUuid () {
        return uuid;
    }



    public Integer getAttachmentId () {
        return attachmentId;
    }

    public String getContentType () {
        return contentType;
    }

    public String getDescription () {
        return description;
    }

    public void setDescription (String description) {
        this.description = description;
    }

    public Integer getEntityInstanceId () {
        return entityInstanceId;
    }

    public String getEntityType () {
        return entityType;
    }

    public String getFilename () {
        return filename;
    }

    public byte[] getThumbnail () {
        return thumbnail;
    }

    public String getViewerUrl () {
        return viewerUrl;
    }

    public String getAction () {
        return action;
    }

    public void setAction (String action) {
        this.action =action;
    }

    public void setAttachmentId(Integer attachmentId) {
        this.attachmentId = attachmentId;
    }

    public void setEntityInstanceId(Integer entityInstanceId) {
        this.entityInstanceId = entityInstanceId;
    }

    public void setEntityType(String entityType) {
        this.entityType = entityType;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getTntityType() {
        return tntityType;
    }

    public void setTntityType(String tntityType) {
        this.tntityType = tntityType;
    }

    public void setThumbnail(byte[] thumbnail) {
        this.thumbnail = thumbnail;
    }

    public void setViewerUrl(String viewerUrl) {
        this.viewerUrl = viewerUrl;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public boolean isPreviewAvailable () {
        return getViewerUrl() != null;
    }

    public boolean isThumbnailAvailable () {
        return getThumbnail() != null;
    }

    public String getSessionInfoXml() {
        return sessionInfoXml;
    }

    public void setSessionInfoXml(String sessionInfoXml) {
        this.sessionInfoXml = sessionInfoXml;
    }

    public boolean isClonedAttachment () {
        return clonedAttachment;
    }

    public void setClonedAttachment (boolean clonedAttachment) {
        this.clonedAttachment = clonedAttachment;
    }
}