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