blob: f145aa4da2ce18044c95f12e327f9fd8907ce9a3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.orchestrator.restapi.wire;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
/**
* @author andreer
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class UpdateHostResponse {
public static final String FIELD_NAME_HOSTNAME = "hostname";
public static final String FIELD_NAME_REASON = "reason";
private final String hostname;
private final HostStateChangeDenialReason hostStateChangeDenialReason;
@JsonCreator
public UpdateHostResponse(
@JsonProperty(FIELD_NAME_HOSTNAME) final String hostname,
@JsonProperty(FIELD_NAME_REASON) final HostStateChangeDenialReason hostStateChangeDenialReason) {
this.hostname = hostname;
this.hostStateChangeDenialReason = hostStateChangeDenialReason;
}
@JsonProperty(FIELD_NAME_HOSTNAME)
public String hostname() {
return hostname;
}
@JsonProperty(FIELD_NAME_REASON)
public HostStateChangeDenialReason reason() {
return hostStateChangeDenialReason;
}
@Override
public boolean equals(final Object o) {
if (!(o instanceof UpdateHostResponse)) {
return false;
}
final UpdateHostResponse other = (UpdateHostResponse) o;
if (!Objects.equals(this.hostname, other.hostname)) return false;
if (!Objects.equals(this.hostStateChangeDenialReason, other.hostStateChangeDenialReason)) return false;
return true;
}
@Override
public int hashCode() {
return Objects.hash(hostname, hostStateChangeDenialReason);
}
}
|