985f51035cba78efa0a0c40075b80b41351e6c32
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / Customer.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.bpmn.servicedecomposition.bbobjects;
22
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.List;
26
27 import javax.persistence.Id;
28
29 import com.fasterxml.jackson.annotation.JsonProperty;
30 import com.fasterxml.jackson.annotation.JsonRootName;
31 import org.apache.commons.lang3.builder.EqualsBuilder;
32 import org.apache.commons.lang3.builder.HashCodeBuilder;
33 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
34
35 @JsonRootName("customer")
36 public class Customer implements Serializable, ShallowCopy<Customer> {
37
38         private static final long serialVersionUID = 2006599484099139618L;
39
40         @Id
41         @JsonProperty("global-customer-id")
42         private String globalCustomerId;
43         @JsonProperty("subscriber-name")
44         private String subscriberName;
45         @JsonProperty("subscriber-type")
46         private String subscriberType;
47         @JsonProperty("subscriber-common-site-id")
48         private String subscriberCommonSiteId;
49         @JsonProperty("service-subscription")
50     private ServiceSubscription serviceSubscription;
51     @JsonProperty("vpn-bindings")
52         private List<VpnBinding> vpnBindings = new ArrayList<>();
53
54         public String getGlobalCustomerId() {
55                 return globalCustomerId;
56         }
57         public void setGlobalCustomerId(String globalCustomerId) {
58                 this.globalCustomerId = globalCustomerId;
59         }
60         public String getSubscriberName() {
61                 return subscriberName;
62         }
63         public void setSubscriberName(String subscriberName) {
64                 this.subscriberName = subscriberName;
65         }
66         public String getSubscriberType() {
67                 return subscriberType;
68         }
69         public void setSubscriberType(String subscriberType) {
70                 this.subscriberType = subscriberType;
71         }
72         public String getSubscriberCommonSiteId() {
73                 return subscriberCommonSiteId;
74         }
75         public void setSubscriberCommonSiteId(String subscriberCommonSiteId) {
76                 this.subscriberCommonSiteId = subscriberCommonSiteId;
77         }
78         public ServiceSubscription getServiceSubscription() {
79                 return serviceSubscription;
80         }
81         public void setServiceSubscription(ServiceSubscription serviceSubscription) {
82                 this.serviceSubscription = serviceSubscription;
83         }
84         public List<VpnBinding> getVpnBindings() {
85                 return vpnBindings;
86         }
87         @Override
88         public boolean equals(final Object other) {
89                 if (!(other instanceof Customer)) {
90                         return false;
91                 }
92                 Customer castOther = (Customer) other;
93                 return new EqualsBuilder().append(globalCustomerId, castOther.globalCustomerId).isEquals();
94         }
95         @Override
96         public int hashCode() {
97                 return new HashCodeBuilder().append(globalCustomerId).toHashCode();
98         }
99 }