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