001package com.thed.model;
002
003import java.util.Date;
004
005/**
006 * Represents a file attachment.  Files will be stored in the repository, which inturn gets saved within the database.
007 * When an Attachment is first uploaded and stored, its reporsitoryId and repositoryParentId is stored. This is a generic
008 * attachment functionality available to wide variety of entities e.g
009 * @see com.thed.model.Requirement
010 *
011 * @author nirav
012 *
013 */
014public class Attachment{
015
016    private long id;
017        private String refId;
018        private String name;
019        private String description;
020    private Date timeStamp;
021        private Long itemId;
022        private String itemType;
023        private Long createdBy;
024        private String contentType;
025        private String fileSize;
026        private String tempPath;
027
028        
029    public Long getItemId() {
030                return itemId;
031        }
032
033        public long getId() {
034        return id;
035    }
036
037    public void setId(long id) {
038        this.id = id;
039    }
040
041        public String getRefId() {
042                return refId;
043        }
044
045        public void setRefId(String refId) {
046                this.refId = refId;
047        }
048
049        /**
050         * @return the name
051         */
052        public String getName() {
053                return name;
054        }
055
056        /**
057         * @param name the name to set
058         */
059        public void setName(String name) {
060                this.name = name;
061        }
062
063        /**
064         * @return the timeStamp
065         */
066        public Date getTimeStamp() {
067                return timeStamp;
068        }
069
070        /**
071         * @param timeStamp the timeStamp to set
072         */
073        public void setTimeStamp(Date timeStamp) {
074                this.timeStamp = timeStamp;
075        }
076        
077        /**
078         * @return the itemType
079         */
080        public String getItemType() {
081                return itemType;
082        }
083
084        /**
085         * @param itemType the itemType to set
086         */
087        public void setItemType(String itemType) {
088                this.itemType = itemType;
089        }
090
091        /**
092         * @return the createdBy
093         */
094        public Long getCreatedBy() {
095                return createdBy;
096        }
097
098        /**
099         * @param createdBy the createdBy to set
100         */
101        public void setCreatedBy(Long createdBy) {
102                this.createdBy = createdBy;
103        }
104
105        /**
106         * @return the description
107         */
108        public String getDescription() {
109                return description;
110        }
111
112        /**
113         * @param description the description to set
114         */
115        public void setDescription(String description) {
116                this.description = description;
117        }
118
119        /**
120         * @return the contentType
121         */
122        public String getContentType() {
123                return contentType;
124        }
125
126        /**
127         * @param contentType the contentType to set
128         */
129        public void setContentType(String contentType) {
130                this.contentType = contentType;
131        }
132
133        /**
134         * @return the fileSize
135         */
136        public String getFileSize() {
137                return fileSize;
138        }
139
140        /**
141         * @param fileSize the fileSize to set
142         */
143        public void setFileSize(String fileSize) {
144                this.fileSize = fileSize;
145        }
146
147        /**
148         * @return the tempPath
149         */
150        public String getTempPath() {
151                return tempPath;
152        }
153        
154        /**
155         * @param tempPath the tempPath to set
156         */
157        public void setTempPath(String tempPath) {
158                this.tempPath = tempPath;
159        }
160
161        /**
162         * @param itemId the itemId to set
163         */
164        public void setItemId(Long itemId) {
165                this.itemId = itemId;
166        }
167        
168        //Fixed ZEPHYR=5081: <Activity Log/Defects Admin/Requirements> Deleting requirement with attachments in Requirements should show the relevant id in the data field
169        @Override
170        public String toString() {
171                return """
172                                id:%d name:%s""".formatted(id, name);
173        }
174
175}