2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.bpmn.servicedecomposition.bbobjects;
23 import com.fasterxml.jackson.annotation.JsonProperty;
24 import com.fasterxml.jackson.annotation.JsonRootName;
26 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
27 import org.onap.so.bpmn.servicedecomposition.homingobjects.SolutionCandidates;
28 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceProxy;
30 import java.io.Serializable;
31 import javax.persistence.Id;
33 import org.apache.commons.lang3.builder.EqualsBuilder;
34 import org.apache.commons.lang3.builder.HashCodeBuilder;
36 @JsonRootName("service-proxy")
37 public class ServiceProxy extends SolutionCandidates implements Serializable, ShallowCopy<ServiceProxy> {
38 private static final long serialVersionUID = 1491890223056651430L;
47 @JsonProperty("service-instance")
48 private ServiceInstance serviceInstance;
50 @JsonProperty("model-info-service-proxy")
51 private ModelInfoServiceProxy modelInfoServiceProxy;
54 public String getId() {
58 public void setId(String id) {
63 * Way to identify the type of proxy
64 * i.e. "infrastructure", "transport", etc.
66 public String getType() {
71 * Way to identify the type of proxy
72 * i.e. "infrastructure", "transport", etc.
74 public void setType(String type) {
78 public ServiceInstance getServiceInstance() {
79 return serviceInstance;
82 public void setServiceInstance(ServiceInstance serviceInstance) {
83 this.serviceInstance = serviceInstance;
86 public ModelInfoServiceProxy getModelInfoServiceProxy() {
87 return modelInfoServiceProxy;
90 public void setModelInfoServiceProxy(ModelInfoServiceProxy modelInfoServiceProxy) {
91 this.modelInfoServiceProxy = modelInfoServiceProxy;
95 public boolean equals(final Object other){
96 if(!(other instanceof ServiceProxy)){
99 ServiceProxy castOther = (ServiceProxy) other;
100 return new EqualsBuilder().append(id, castOther.id).isEquals();
104 public int hashCode(){
105 return new HashCodeBuilder().append(id).toHashCode();