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

com.hashicorp.nomad.apimodel.RaftServer 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 RaftServer extends ApiObject {
    private String id;
    private String node;
    private String address;
    private boolean leader;
    private boolean voter;

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

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

    @JsonProperty("Node")
    public String getNode() {
        return node;
    }

    public RaftServer setNode(String node) {
        this.node = node;
        return this;
    }

    @JsonProperty("Address")
    public String getAddress() {
        return address;
    }

    public RaftServer setAddress(String address) {
        this.address = address;
        return this;
    }

    @JsonProperty("Leader")
    public boolean getLeader() {
        return leader;
    }

    public RaftServer setLeader(boolean leader) {
        this.leader = leader;
        return this;
    }

    @JsonProperty("Voter")
    public boolean getVoter() {
        return voter;
    }

    public RaftServer setVoter(boolean voter) {
        this.voter = voter;
        return this;
    }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy