aboutsummaryrefslogtreecommitdiffstats
path: root/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/wire/HostService.java
blob: 30dfa4ba3982fbfb26a4c3d48962f71a1ee16726 (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
// Copyright Vespa.ai. 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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Objects;

/**
 * @author hakonhall
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HostService {
    @JsonProperty("clusterId")
    public final String clusterId;

    @JsonProperty("serviceType")
    public final String serviceType;

    @JsonProperty("configId")
    public final String configId;

    @JsonProperty("serviceStatus")
    public final String serviceStatus;

    @JsonCreator
    public HostService(@JsonProperty("clusterId") String clusterId,
                       @JsonProperty("serviceType") String serviceType,
                       @JsonProperty("configId") String configId,
                       @JsonProperty("serviceStatus") String serviceStatus) {
        this.clusterId = clusterId;
        this.serviceType = serviceType;
        this.configId = configId;
        this.serviceStatus = serviceStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        HostService that = (HostService) o;
        return Objects.equals(clusterId, that.clusterId) &&
                Objects.equals(serviceType, that.serviceType) &&
                Objects.equals(configId, that.configId) &&
                Objects.equals(serviceStatus, that.serviceStatus);
    }

    @Override
    public int hashCode() {
        return Objects.hash(clusterId, serviceType, configId, serviceStatus);
    }
}