[SO] Release so 1.13.0 image
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / ExternalServiceToInternalService.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 javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.GenerationType;
28 import javax.persistence.Id;
29 import javax.persistence.Table;
30 import org.apache.commons.lang3.builder.EqualsBuilder;
31 import org.apache.commons.lang3.builder.HashCodeBuilder;
32 import org.apache.commons.lang3.builder.ToStringBuilder;
33 import com.openpojo.business.annotation.BusinessKey;
34 import uk.co.blackpepper.bowman.annotation.RemoteResource;
35
36 @Entity
37 @RemoteResource("/externalServiceToInternalService")
38 @Table(name = "external_service_to_internal_model_mapping")
39 public class ExternalServiceToInternalService implements Serializable {
40
41     /**
42      * 
43      */
44     private static final long serialVersionUID = 3825246668050173010L;
45
46     @Id
47     @Column(name = "Id")
48     @GeneratedValue(strategy = GenerationType.IDENTITY)
49     private Integer id;
50
51     @BusinessKey
52     @Column(name = "SERVICE_NAME")
53     private String serviceName;
54
55     @BusinessKey
56     @Column(name = "PRODUCT_FLAVOR")
57     private String productFlavor;
58
59     @BusinessKey
60     @Column(name = "SUBSCRIPTION_SERVICE_TYPE")
61     private String subscriptionServiceType;
62
63     @BusinessKey
64     @Column(name = "SERVICE_MODEL_UUID")
65     private String serviceModelUUID;
66
67     @Override
68     public boolean equals(final Object other) {
69         if (!(other instanceof ExternalServiceToInternalService)) {
70             return false;
71         }
72         ExternalServiceToInternalService castOther = (ExternalServiceToInternalService) other;
73         return new EqualsBuilder().append(serviceName, castOther.serviceName)
74                 .append(productFlavor, castOther.productFlavor)
75                 .append(subscriptionServiceType, castOther.subscriptionServiceType)
76                 .append(serviceModelUUID, castOther.serviceModelUUID).isEquals();
77     }
78
79     @Override
80     public int hashCode() {
81         return new HashCodeBuilder().append(serviceName).append(productFlavor).append(subscriptionServiceType)
82                 .append(serviceModelUUID).toHashCode();
83     }
84
85     @Override
86     public String toString() {
87         return new ToStringBuilder(this).append("id", id).append("serviceName", serviceName)
88                 .append("productFlavor", productFlavor).append("subscriptionServiceType", subscriptionServiceType)
89                 .append("serviceModelUUID", serviceModelUUID).toString();
90     }
91
92     public Integer getId() {
93         return id;
94     }
95
96     public void setId(Integer id) {
97         this.id = id;
98     }
99
100     public String getServiceName() {
101         return serviceName;
102     }
103
104     public void setServiceName(String serviceName) {
105         this.serviceName = serviceName;
106     }
107
108     public String getProductFlavor() {
109         return productFlavor;
110     }
111
112     public void setProductFlavor(String productFlavor) {
113         this.productFlavor = productFlavor;
114     }
115
116     public String getSubscriptionServiceType() {
117         return subscriptionServiceType;
118     }
119
120     public void setSubscriptionServiceType(String subscriptionServiceType) {
121         this.subscriptionServiceType = subscriptionServiceType;
122     }
123
124     public String getServiceModelUUID() {
125         return serviceModelUUID;
126     }
127
128     public void setServiceModelUUID(String serviceModelUUID) {
129         this.serviceModelUUID = serviceModelUUID;
130     }
131 }