Divide the MSB source codes into two repos
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / onap / msb / apiroute / api / RouteServer.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.Objects;
22
23
24 public class RouteServer implements Serializable{
25         private static final long serialVersionUID = 1L;
26          @ApiModelProperty(required = true)
27         private String ip;
28          
29          @ApiModelProperty(required = true) 
30         private String port;
31         private int weight=0;
32
33         public String getIp() {
34                 return ip;
35         }
36
37         public void setIp(String ip) {
38                 this.ip = ip;
39         }
40
41         
42
43         public int getWeight() {
44                 return weight;
45         }
46
47         public void setWeight(int weight) {
48                 this.weight = weight;
49         }
50         
51         public RouteServer(){
52                 
53         }
54         
55         public RouteServer(String ip,String port){
56                 this.ip=ip;
57                 this.port=port;
58                 this.weight=0;
59         }
60
61     public String getPort() {
62         return port;
63     }
64
65     public void setPort(String port) {
66         this.port = port;
67     }
68
69         @Override
70         public boolean equals(Object o) {
71                 if (this == o) return true;
72                 if (o == null || getClass() != o.getClass()) return false;
73                 RouteServer that = (RouteServer) o;
74                 return Objects.equals(weight, that.weight) &&
75                                 Objects.equals(ip, that.ip) &&
76                                 Objects.equals(port, that.port);
77         }
78
79         @Override
80         public int hashCode() {
81                 return Objects.hash(ip, port, weight);
82         }
83 }