Divide the MSB source codes into two repos
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / onap / msb / apiroute / api / Node.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 public class Node implements Serializable {
24     private static final long serialVersionUID = 1L;
25
26     @ApiModelProperty(required = true)
27     private String ip;
28     
29     @ApiModelProperty(required = true)
30     private String port;
31     
32     private String status="passing"; //实例健康检查状态
33     
34     private int ttl=-1;
35   
36     public String getStatus() {
37       return status;
38   }
39
40   public void setStatus(String status) {
41       this.status = status;
42   }
43
44     public String getIp() {
45         return ip;
46     }
47
48     public void setIp(String ip) {
49         this.ip = ip;
50     }
51
52     public String getPort() {
53         return port;
54     }
55
56     public void setPort(String port) {
57         this.port = port;
58     }
59
60     public int getTtl() {
61         return ttl;
62     }
63
64     public void setTtl(int ttl) {
65         this.ttl = ttl;
66     }
67
68     public Node(){
69         
70     }
71     
72     public Node(String ip,String port,int ttl){
73         this.ip = ip;
74         this.port = port;
75         this.ttl = ttl;
76     }
77     
78     public Node(String ip,String port){
79       this.ip = ip;
80       this.port = port;
81   }
82
83     @Override
84     public boolean equals(Object o) {
85         if (this == o) return true;
86         if (o == null || getClass() != o.getClass()) return false;
87         Node node = (Node) o;
88         return Objects.equals(ttl, node.ttl) &&
89                 Objects.equals(ip, node.ip) &&
90                 Objects.equals(port, node.port) &&
91                 Objects.equals(status, node.status);
92     }
93
94     @Override
95     public int hashCode() {
96         return Objects.hash(ip, port, status, ttl);
97     }
98 }