Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / Pnf.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 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
25 import javax.persistence.Id;
26
27 import org.apache.commons.lang3.builder.EqualsBuilder;
28 import org.apache.commons.lang3.builder.HashCodeBuilder;
29 import org.onap.so.db.catalog.beans.OrchestrationStatus;
30
31 import com.fasterxml.jackson.annotation.JsonProperty;
32 import com.fasterxml.jackson.annotation.JsonRootName;
33 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
34
35 @JsonRootName("pnf")
36 public class Pnf implements Serializable, ShallowCopy<Pnf> {
37
38         private static final long serialVersionUID = -2544848120774529501L;
39
40         @Id
41     @JsonProperty("pnf-id")
42     private String pnfId;
43
44     @JsonProperty("pnf-name")
45     private String pnfName;
46
47     @JsonProperty("role")
48     private String role;
49
50         @JsonProperty("orchestration-status")
51         private OrchestrationStatus orchestrationStatus;
52
53     @JsonProperty("cloud-region")
54     private CloudRegion cloudRegion;
55
56
57         public String getPnfId() {
58                 return pnfId;
59         }
60
61         public void setPnfId(String pnfId) {
62                 this.pnfId = pnfId;
63         }
64
65         public String getPnfName() {
66                 return pnfName;
67         }
68
69         public void setPnfName(String pnfName) {
70                 this.pnfName = pnfName;
71         }
72
73         /**
74          * Distinguishes Primary or Secondary
75          */
76         public String getRole() {
77                 return role;
78         }
79
80         /**
81          * Distinguishes Primary or Secondary
82          */
83         public void setRole(String role) {
84                 this.role = role;
85         }
86
87         public OrchestrationStatus getOrchestrationStatus() {
88                 return orchestrationStatus;
89         }
90
91         public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
92                 this.orchestrationStatus = orchestrationStatus;
93         }
94
95         public CloudRegion getCloudRegion() {
96                 return cloudRegion;
97         }
98
99         public void setCloudRegion(CloudRegion cloudRegion) {
100                 this.cloudRegion = cloudRegion;
101         }
102
103         @Override
104         public boolean equals(final Object other) {
105                 if (!(other instanceof Pnf)) {
106                         return false;
107                 }
108                 Pnf castOther = (Pnf) other;
109                 return new EqualsBuilder().append(pnfId, castOther.pnfId).isEquals();
110         }
111
112         @Override
113         public int hashCode() {
114                 return new HashCodeBuilder().append(pnfId).toHashCode();
115         }
116 }