Divide the MSB source codes into two repos
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / onap / msb / apiroute / api / ApiRouteInfo.java
1 /**
2  * Copyright 2016 ZTE, Inc. and others.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.msb.apiroute.api;
17
18 import io.swagger.annotations.ApiModelProperty;
19
20 import java.io.Serializable;
21 import java.util.Arrays;
22 import java.util.Objects;
23
24
25 public class ApiRouteInfo extends RouteInfo {
26         private static final long serialVersionUID = 1L;
27         
28         @ApiModelProperty(example = "v1", required = true)
29         private String  version;  
30         
31         
32         private String  apiJson="";  //swagger json Path
33         
34          @ApiModelProperty(value = "[apiJson Type] 0:local file  1: remote file", allowableValues = "0,1", example = "1")
35         private String apiJsonType="1";  
36         private String  metricsUrl="";     
37   
38    
39  
40         public String getVersion() {
41                 return version;
42         }
43         public void setVersion(String version) {
44                 this.version = version;
45         }
46         
47         public String getApiJson() {
48                 return apiJson;
49         }
50         public void setApiJson(String apiJson) {
51                 this.apiJson = apiJson;
52         }
53         
54         
55         
56
57         public String getApiJsonType() {
58                 return apiJsonType;
59         }
60         public void setApiJsonType(String apiJsonType) {
61                 this.apiJsonType = apiJsonType;
62         }
63         public String getMetricsUrl() {
64                 return metricsUrl;
65         }
66         public void setMetricsUrl(String metricsUrl) {
67                 this.metricsUrl = metricsUrl;
68         }
69         
70    
71    
72    
73     @Override  
74     public Object clone() throws CloneNotSupportedException  
75     {  
76         return super.clone();  
77     }
78     
79         @Override
80         public boolean equals(Object o) {
81                 if (this == o) return true;
82                 if (o == null || getClass() != o.getClass()) return false;
83                 ApiRouteInfo that = (ApiRouteInfo) o;
84                 return Objects.equals(isEnable_ssl(), that.isEnable_ssl()) &&
85                                 Objects.equals(getServiceName(), that.getServiceName()) &&
86                                 Objects.equals(version, that.version) &&
87                                 Objects.equals(getUrl(), that.getUrl()) &&
88                                 Objects.equals(apiJson, that.apiJson) &&
89                                 Objects.equals(apiJsonType, that.apiJsonType) &&
90                                 Objects.equals(metricsUrl, that.metricsUrl) &&
91                                 Objects.equals(getControl(), that.getControl()) &&
92                                 Objects.equals(getStatus(), that.getStatus()) &&
93                                 Objects.equals(getVisualRange(), that.getVisualRange()) &&
94                                 Objects.equals(getUseOwnUpstream(), that.getUseOwnUpstream()) &&
95                                 Arrays.equals(getServers(), that.getServers()) &&
96                                 Objects.equals(getHost(), that.getHost()) &&
97                                 Objects.equals(getNamespace(), that.getNamespace()) &&
98                                 Objects.equals(getPublish_port(), that.getPublish_port()) &&
99                                 Objects.equals(getConsulServiceName(), that.getConsulServiceName()) &&
100                                 Objects.equals(getPublishProtocol(), that.getPublishProtocol());
101         }
102
103         @Override
104         public int hashCode() {
105                 return Objects.hash(getServiceName(), version, getUrl(), apiJson, apiJsonType, metricsUrl, getControl(), getStatus(), getVisualRange(), getServers(), getHost(), getNamespace(), getPublish_port(), isEnable_ssl(), getConsulServiceName(), getPublishProtocol());
106         }
107 }