1953ba410bac5401b476e958826e280e6091d8c4
[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.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
28 import org.onap.so.db.catalog.beans.OrchestrationStatus;
29 import com.fasterxml.jackson.annotation.JsonProperty;
30 import com.fasterxml.jackson.annotation.JsonRootName;
31 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
32
33 @JsonRootName("pnf")
34 public class Pnf implements Serializable, ShallowCopy<Pnf> {
35
36     private static final long serialVersionUID = -2544848120774529501L;
37
38     @Id
39     @JsonProperty("pnf-id")
40     private String pnfId;
41
42     @JsonProperty("pnf-name")
43     private String pnfName;
44
45     @JsonProperty("nf-role")
46     private String role;
47
48     @JsonProperty("orchestration-status")
49     private OrchestrationStatus orchestrationStatus;
50
51     @JsonProperty("cloud-region")
52     private CloudRegion cloudRegion;
53
54     @JsonProperty("model-info-pnf")
55     private ModelInfoPnf modelInfoPnf;
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     public ModelInfoPnf getModelInfoPnf() {
104         return modelInfoPnf;
105     }
106
107     public void setModelInfoPnf(ModelInfoPnf modelInfoPnf) {
108         this.modelInfoPnf = modelInfoPnf;
109     }
110
111     @Override
112     public boolean equals(final Object other) {
113         if (!(other instanceof Pnf)) {
114             return false;
115         }
116         Pnf castOther = (Pnf) other;
117         return new EqualsBuilder().append(pnfId, castOther.pnfId).isEquals();
118     }
119
120     @Override
121     public int hashCode() {
122         return new HashCodeBuilder().append(pnfId).toHashCode();
123     }
124 }