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