Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / ServiceProxy.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 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 com.fasterxml.jackson.annotation.JsonProperty;
24 import com.fasterxml.jackson.annotation.JsonRootName;
25 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
26 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionCandidates;
27 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceProxy;
28 import java.io.Serializable;
29 import javax.persistence.Id;
30 import org.apache.commons.lang3.builder.EqualsBuilder;
31 import org.apache.commons.lang3.builder.HashCodeBuilder;
32
33 @JsonRootName("service-proxy")
34 public class ServiceProxy extends SolutionCandidates implements Serializable, ShallowCopy<ServiceProxy> {
35     private static final long serialVersionUID = 1491890223056651430L;
36
37     @Id
38     @JsonProperty("id")
39     private String id;
40
41     @JsonProperty("type")
42     private String type;
43
44     @JsonProperty("service-instance")
45     private ServiceInstance serviceInstance;
46
47     @JsonProperty("model-info-service-proxy")
48     private ModelInfoServiceProxy modelInfoServiceProxy;
49
50
51     public String getId() {
52         return id;
53     }
54
55     public void setId(String id) {
56         this.id = id;
57     }
58
59     /**
60      * Way to identify the type of proxy i.e. "infrastructure", "transport", etc.
61      */
62     public String getType() {
63         return type;
64     }
65
66     /**
67      * Way to identify the type of proxy i.e. "infrastructure", "transport", etc.
68      */
69     public void setType(String type) {
70         this.type = type;
71     }
72
73     public ServiceInstance getServiceInstance() {
74         return serviceInstance;
75     }
76
77     public void setServiceInstance(ServiceInstance serviceInstance) {
78         this.serviceInstance = serviceInstance;
79     }
80
81     public ModelInfoServiceProxy getModelInfoServiceProxy() {
82         return modelInfoServiceProxy;
83     }
84
85     public void setModelInfoServiceProxy(ModelInfoServiceProxy modelInfoServiceProxy) {
86         this.modelInfoServiceProxy = modelInfoServiceProxy;
87     }
88
89     @Override
90     public boolean equals(final Object other) {
91         if (!(other instanceof ServiceProxy)) {
92             return false;
93         }
94         ServiceProxy castOther = (ServiceProxy) other;
95         return new EqualsBuilder().append(id, castOther.id).isEquals();
96     }
97
98     @Override
99     public int hashCode() {
100         return new HashCodeBuilder().append(id).toHashCode();
101     }
102
103 }