Correct Catalog DB beans
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / UserParameters.java
1 package org.onap.so.db.catalog.beans;
2
3 import java.io.Serializable;
4 import java.util.Date;
5 import javax.persistence.Column;
6 import javax.persistence.Entity;
7 import javax.persistence.GeneratedValue;
8 import javax.persistence.GenerationType;
9 import javax.persistence.Id;
10 import javax.persistence.PrePersist;
11 import javax.persistence.Table;
12 import javax.persistence.Temporal;
13 import javax.persistence.TemporalType;
14 import org.apache.commons.lang3.builder.EqualsBuilder;
15 import org.apache.commons.lang3.builder.HashCodeBuilder;
16 import org.apache.commons.lang3.builder.ToStringBuilder;
17 import com.openpojo.business.annotation.BusinessKey;
18
19 @Entity
20 @Table(name = "USER_PARAMETERS")
21 public class UserParameters implements Serializable {
22
23     private static final long serialVersionUID = -5036895978102778877L;
24
25     @Id
26     @Column(name = "ID", nullable = false, updatable = false)
27     @GeneratedValue(strategy = GenerationType.IDENTITY)
28     private Integer ID;
29
30     @BusinessKey
31     @Column(name = "NAME")
32     private String name;
33
34     @Column(name = "PAYLOAD_LOCATION")
35     private String payloadLocation;
36
37     @Column(name = "LABEL")
38     private String label;
39
40     @Column(name = "TYPE")
41     private String type;
42
43     @Column(name = "DESCRIPTION")
44     private String description;
45
46     @Column(name = "IS_REQUIRED")
47     private Boolean isRequried;
48
49     @Column(name = "MAX_LENGTH")
50     private Integer maxLength;
51
52     @Column(name = "ALLOWABLE_CHARS")
53     private String allowableChars;
54
55     @Column(name = "CREATION_TIMESTAMP", updatable = false)
56     @Temporal(TemporalType.TIMESTAMP)
57     private Date created;
58
59     @PrePersist
60     protected void onCreate() {
61         this.created = new Date();
62     }
63
64     public Integer getID() {
65         return ID;
66     }
67
68     public String getName() {
69         return name;
70     }
71
72     public void setName(String name) {
73         this.name = name;
74     }
75
76     @Override
77     public String toString() {
78         return new ToStringBuilder(this).append("name", name).toString();
79     }
80
81     public String getPayloadLocation() {
82         return payloadLocation;
83     }
84
85     public void setPayloadLocation(String payloadLocation) {
86         this.payloadLocation = payloadLocation;
87     }
88
89     public String getLabel() {
90         return label;
91     }
92
93     public void setLabel(String label) {
94         this.label = label;
95     }
96
97     public String getType() {
98         return type;
99     }
100
101     public void setType(String type) {
102         this.type = type;
103     }
104
105     public String getDescription() {
106         return description;
107     }
108
109     public void setDescription(String description) {
110         this.description = description;
111     }
112
113     public Boolean getIsRequried() {
114         return isRequried;
115     }
116
117     public void setIsRequried(Boolean isRequried) {
118         this.isRequried = isRequried;
119     }
120
121     public Integer getMaxLength() {
122         return maxLength;
123     }
124
125     public void setMaxLength(Integer maxLength) {
126         this.maxLength = maxLength;
127     }
128
129     public String getAllowableChars() {
130         return allowableChars;
131     }
132
133     public void setAllowableChars(String allowableChars) {
134         this.allowableChars = allowableChars;
135     }
136
137     public Date getCreated() {
138         return created;
139     }
140
141     public void setCreated(Date created) {
142         this.created = created;
143     }
144
145     @Override
146     public boolean equals(final Object other) {
147         if (!(other instanceof UserParameters)) {
148             return false;
149         }
150         UserParameters castOther = (UserParameters) other;
151         return new EqualsBuilder().append(name, castOther.name).isEquals();
152     }
153
154     @Override
155     public int hashCode() {
156         return new HashCodeBuilder().append(name).toHashCode();
157     }
158 }