Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / HeatFiles.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.db.catalog.beans;
22
23 import java.io.Serializable;
24 import java.util.Date;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.Id;
28 import javax.persistence.Lob;
29 import javax.persistence.PrePersist;
30 import javax.persistence.Table;
31 import javax.persistence.Temporal;
32 import javax.persistence.TemporalType;
33 import org.apache.commons.lang3.builder.EqualsBuilder;
34 import org.apache.commons.lang3.builder.HashCodeBuilder;
35 import org.apache.commons.lang3.builder.ToStringBuilder;
36 import com.openpojo.business.annotation.BusinessKey;
37
38 @Entity
39 @Table(name = "heat_files")
40 public class HeatFiles implements Serializable {
41
42     private static final long serialVersionUID = 768026109321305392L;
43
44     @BusinessKey
45     @Id
46     @Column(name = "ARTIFACT_UUID")
47     private String artifactUuid;
48
49     @Column(name = "DESCRIPTION")
50     private String description = null;
51
52     @Column(name = "NAME")
53     private String fileName;
54
55     @Lob
56     @Column(name = "BODY", columnDefinition = "LONGTEXT")
57     private String fileBody;
58
59     @Column(name = "CREATION_TIMESTAMP", updatable = false)
60     @Temporal(TemporalType.TIMESTAMP)
61     private Date created;
62
63     @Column(name = "ARTIFACT_CHECKSUM")
64     private String artifactChecksum;
65
66     @Column(name = "VERSION")
67     private String version;
68
69     @PrePersist
70     protected void onCreate() {
71         this.created = new Date();
72     }
73
74     @Override
75     public String toString() {
76         return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description)
77                 .append("fileName", fileName).append("fileBody", fileBody).append("created", created)
78                 .append("artifactChecksum", artifactChecksum).toString();
79     }
80
81     @Override
82     public boolean equals(final Object other) {
83         if (!(other instanceof HeatFiles)) {
84             return false;
85         }
86         HeatFiles castOther = (HeatFiles) other;
87         return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals();
88     }
89
90     @Override
91     public int hashCode() {
92         return new HashCodeBuilder().append(artifactUuid).toHashCode();
93     }
94
95     public String getArtifactUuid() {
96         return this.artifactUuid;
97     }
98
99     public void setArtifactUuid(String artifactUuid) {
100         this.artifactUuid = artifactUuid;
101     }
102
103     public String getDescription() {
104         return this.description;
105     }
106
107     public void setDescription(String description) {
108         this.description = description;
109     }
110
111     public String getFileName() {
112         return this.fileName;
113     }
114
115     public void setFileName(String fileName) {
116         this.fileName = fileName;
117     }
118
119     public String getFileBody() {
120         return this.fileBody;
121     }
122
123     public void setFileBody(String fileBody) {
124         this.fileBody = fileBody;
125     }
126
127     public Date getCreated() {
128         return created;
129     }
130
131     public String getAsdcUuid() {
132         return this.artifactUuid;
133     }
134
135     public void setAsdcUuid(String artifactUuid) {
136         this.artifactUuid = artifactUuid;
137     }
138
139     public String getArtifactChecksum() {
140         return artifactChecksum;
141     }
142
143     public void setArtifactChecksum(String artifactChecksum) {
144         this.artifactChecksum = artifactChecksum;
145     }
146
147     public String getVersion() {
148         return version;
149     }
150
151     public void setVersion(String version) {
152         this.version = version;
153     }
154 }