All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hashicorp.nomad.apimodel.Service Maven / Gradle / Ivy

There is a newer version: 0.11.3.0
Show newest version
package com.hashicorp.nomad.apimodel;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.hashicorp.nomad.javasdk.ApiObject;
import com.hashicorp.nomad.javasdk.NomadJson;

import java.io.IOException;
import java.util.List;

/**
 * This is a generated JavaBean representing a request or response structure.
 *
 * @see Nomad HTTP API documentation associated with the endpoint you are using.
 */
public final class Service extends ApiObject {
    private String id;
    private String name;
    private List tags;
    private String portLabel;
    private String addressMode;
    private List checks;
    private CheckRestart checkRestart;

    @JsonProperty("Id")
    public String getId() {
        return id;
    }

    public Service setId(String id) {
        this.id = id;
        return this;
    }

    @JsonProperty("Name")
    public String getName() {
        return name;
    }

    public Service setName(String name) {
        this.name = name;
        return this;
    }

    @JsonProperty("Tags")
    public List getTags() {
        return tags;
    }

    public Service setTags(List tags) {
        this.tags = tags;
        return this;
    }

    public Service addTags(String... tags) {
        if (this.tags == null)
            this.tags = new java.util.ArrayList<>();
        for (String item : tags)
            this.tags.add(item);
        return this;
    }

    @JsonProperty("PortLabel")
    public String getPortLabel() {
        return portLabel;
    }

    public Service setPortLabel(String portLabel) {
        this.portLabel = portLabel;
        return this;
    }

    @JsonProperty("AddressMode")
    public String getAddressMode() {
        return addressMode;
    }

    public Service setAddressMode(String addressMode) {
        this.addressMode = addressMode;
        return this;
    }

    @JsonProperty("Checks")
    public List getChecks() {
        return checks;
    }

    public Service setChecks(List checks) {
        this.checks = checks;
        return this;
    }

    public Service addChecks(ServiceCheck... checks) {
        if (this.checks == null)
            this.checks = new java.util.ArrayList<>();
        for (ServiceCheck item : checks)
            this.checks.add(item);
        return this;
    }

    @JsonProperty("CheckRestart")
    public CheckRestart getCheckRestart() {
        return checkRestart;
    }

    public Service setCheckRestart(CheckRestart checkRestart) {
        this.checkRestart = checkRestart;
        return this;
    }

    @Override
    public String toString() {
        return NomadJson.serialize(this);
    }

    public static Service fromJson(String json) throws IOException {
        return NomadJson.deserialize(json, Service.class);
    }

    public static List fromJsonArray(String json) throws IOException {
        return NomadJson.deserializeList(json, Service.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy