[SO] Release so 1.13.0 image
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / ActivitySpecParameters.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("/activitySpecParameters")
22 @Table(name = "activity_spec_parameters")
23 public class ActivitySpecParameters implements Serializable {
24
25     private static final long serialVersionUID = 3627711377147710046L;
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 = "TYPE")
37     private String type;
38
39     @BusinessKey
40     @Column(name = "DIRECTION")
41     private String direction;
42
43     @Column(name = "DESCRIPTION")
44     private String description;
45
46     @Column(name = "CREATION_TIMESTAMP", updatable = false)
47     @Temporal(TemporalType.TIMESTAMP)
48     private Date created;
49
50     @PrePersist
51     protected void onCreate() {
52         this.created = new Date();
53     }
54
55     @Override
56     public String toString() {
57         return new ToStringBuilder(this).append("name", name).append("direction", direction).toString();
58     }
59
60     @Override
61     public boolean equals(final Object other) {
62         if (!(other instanceof ActivitySpecParameters)) {
63             return false;
64         }
65         ActivitySpecParameters castOther = (ActivitySpecParameters) other;
66         return new EqualsBuilder().append(ID, castOther.ID).isEquals();
67     }
68
69     @Override
70     public int hashCode() {
71         return new HashCodeBuilder().append(ID).toHashCode();
72     }
73
74     public Integer getID() {
75         return ID;
76     }
77
78     public String getName() {
79         return name;
80     }
81
82     public void setName(String name) {
83         this.name = name;
84     }
85
86     public String getType() {
87         return type;
88     }
89
90     public void setType(String type) {
91         this.type = type;
92     }
93
94     public String getDirection() {
95         return direction;
96     }
97
98     public void setDirection(String direction) {
99         this.direction = direction;
100     }
101
102     public String getDescription() {
103         return description;
104     }
105
106     public void setDescription(String description) {
107         this.description = description;
108     }
109
110     public Date getCreated() {
111         return created;
112     }
113
114     public void setCreated(Date created) {
115         this.created = created;
116     }
117 }