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

com.hashicorp.nomad.apimodel.AgentSelf 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;
import java.util.Map;

/**
 * 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 AgentSelf extends ApiObject {
    private Map config;
    private AgentMember member;
    private Map> stats;

    @JsonProperty("config")
    public Map getConfig() {
        return config;
    }

    public AgentSelf setConfig(Map config) {
        this.config = config;
        return this;
    }

    public AgentSelf addConfig(String key, Object value) {
        if (this.config == null)
            this.config = new java.util.HashMap<>();
        this.config.put(key, value);
        return this;
    }

    @JsonProperty("member")
    public AgentMember getMember() {
        return member;
    }

    public AgentSelf setMember(AgentMember member) {
        this.member = member;
        return this;
    }

    @JsonProperty("stats")
    public Map> getStats() {
        return stats;
    }

    public AgentSelf setStats(Map> stats) {
        this.stats = stats;
        return this;
    }

    public AgentSelf addStats(String key, Map value) {
        if (this.stats == null)
            this.stats = new java.util.HashMap<>();
        this.stats.put(key, value);
        return this;
    }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy