Open Kilda Java Documentation
HealthCheckInfoData.java
Go to the documentation of this file.
1 /* Copyright 2017 Telstra Open Source
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package org.openkilda.messaging.info.discovery;
17 
19 
20 import com.fasterxml.jackson.annotation.JsonCreator;
21 import com.fasterxml.jackson.annotation.JsonInclude;
22 import com.fasterxml.jackson.annotation.JsonProperty;
23 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
24 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
25 import com.google.common.base.MoreObjects;
26 
27 import java.util.Objects;
28 
32 @JsonSerialize
33 @JsonInclude(JsonInclude.Include.NON_NULL)
34 @JsonPropertyOrder({
35  "message_type",
36  "id",
37  "state"})
38 public class HealthCheckInfoData extends InfoData {
42  private static final long serialVersionUID = 1L;
43 
47  @JsonProperty("id")
48  protected String id;
49 
53  @JsonProperty("state")
54  protected String state;
55 
60  }
61 
68  @JsonCreator
69  public HealthCheckInfoData(@JsonProperty("id") String id,
70  @JsonProperty("state") String state) {
71  this.id = id;
72  this.state = state;
73 
74  }
75 
81  public String getId() {
82  return id;
83  }
84 
90  public void setId(String id) {
91  this.id = id;
92  }
93 
99  public String getState() {
100  return state;
101  }
102 
108  public void setState(String state) {
109  this.state = state;
110  }
111 
115  @Override
116  public int hashCode() {
117  return Objects.hash(getId(), getState());
118  }
119 
123  @Override
124  public String toString() {
125  return MoreObjects.toStringHelper(this)
126  .add("id", id)
127  .add("state", state)
128  .toString();
129  }
130 
134  @Override
135  public boolean equals(Object object) {
136  if (this == object) {
137  return true;
138  }
139  if (object == null || getClass() != object.getClass()) {
140  return false;
141  }
142 
144  return Objects.equals(getId(), that.getId())
145  && Objects.equals(getState(), that.getState());
146  }
147 }
id
Definition: nodes.py:55
HealthCheckInfoData(@JsonProperty("id") String id, @JsonProperty("state") String state)