Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / PServer.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
24 import com.fasterxml.jackson.annotation.JsonProperty;
25 import org.apache.commons.lang3.builder.HashCodeBuilder;
26 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
27
28 import java.io.Serializable;
29 import java.util.ArrayList;
30 import java.util.List;
31
32 import javax.persistence.Id;
33
34 import org.apache.commons.lang3.builder.EqualsBuilder;
35
36
37 public class PServer implements Serializable, ShallowCopy<PServer> {
38
39         private static final long serialVersionUID = 1378547515775540874L;
40
41         @Id
42     @JsonProperty("pserver-id")
43         private String pserverId;
44     @JsonProperty("hostname")
45         private String hostname;
46     @JsonProperty("physical-links")
47         private List<PhysicalLink> physicalLinks = new ArrayList<PhysicalLink>(); //TODO techincally there is a pInterface between (pserver <--> physical-link) but dont really need that pojo
48
49         public String getPserverId(){
50                 return pserverId;
51         }
52
53         public void setPserverId(String pserverId){
54                 this.pserverId = pserverId;
55         }
56
57         public String getHostname(){
58                 return hostname;
59         }
60
61         public void setHostname(String hostname){
62                 this.hostname = hostname;
63         }
64
65         public List<PhysicalLink> getPhysicalLinks(){
66                 return physicalLinks;
67         }
68
69         @Override
70                 public boolean equals(final Object other){
71                         if(!(other instanceof PServer)){
72                                 return false;
73                         }
74                         PServer castOther = (PServer) other;
75                         return new EqualsBuilder().append(pserverId, castOther.pserverId).isEquals();
76                 }
77
78         @Override
79                 public int hashCode(){
80                         return new HashCodeBuilder().append(pserverId).toHashCode();
81                 }
82
83 }