251c77e5f32321adcc59ef3c3818dda89d0205e2
[msb/discovery.git] / sdclient / discovery-service / src / main / java / org / onap / msb / sdclient / wrapper / consul / model / health / ServiceHealth.java
1 /**
2  * Copyright 2016-2017 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.sdclient.wrapper.consul.model.health;
17
18 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
19 import com.fasterxml.jackson.annotation.JsonProperty;
20 import com.google.common.base.Objects;
21
22
23 @JsonIgnoreProperties(ignoreUnknown = true)
24 public  class ServiceHealth {
25
26     @JsonProperty("Node")
27     public  Node node;
28
29     @JsonProperty("Service")
30     public  Service service;
31
32     public Node getNode() {
33         return node;
34     }
35
36     public void setNode(Node node) {
37         this.node = node;
38     }
39
40     public Service getService() {
41         return service;
42     }
43
44     public void setService(Service service) {
45         this.service = service;
46     }
47     
48     @Override
49     public boolean equals(Object other)
50     {
51         if(this == other)
52             return true;
53         if(other instanceof ServiceHealth)
54         {
55             ServiceHealth that = (ServiceHealth)other;
56             return Objects.equal(node, that.node) && Objects.equal(service, that.service);
57         } else
58         {
59             return false;
60         }
61     }
62     
63     @Override
64     public int hashCode() {
65         return Objects.hashCode(node, service);
66     }
67
68    
69     
70 }