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

com.hashicorp.nomad.apimodel.TaskResourceUsage 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 TaskResourceUsage extends ApiObject {
    private ResourceUsage resourceUsage;
    private long timestamp;
    private Map pids;

    @JsonProperty("ResourceUsage")
    public ResourceUsage getResourceUsage() {
        return resourceUsage;
    }

    public TaskResourceUsage setResourceUsage(ResourceUsage resourceUsage) {
        this.resourceUsage = resourceUsage;
        return this;
    }

    @JsonProperty("Timestamp")
    public long getTimestamp() {
        return timestamp;
    }

    public TaskResourceUsage setTimestamp(long timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    @JsonProperty("Pids")
    public Map getPids() {
        return pids;
    }

    public TaskResourceUsage setPids(Map pids) {
        this.pids = pids;
        return this;
    }

    public TaskResourceUsage addPids(String key, ResourceUsage value) {
        if (this.pids == null)
            this.pids = new java.util.HashMap<>();
        this.pids.put(key, value);
        return this;
    }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy