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

com.hashicorp.nomad.apimodel.SearchResponse 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 SearchResponse extends ApiObject {
    private Map> matches;
    private Map truncations;

    @JsonProperty("Matches")
    public Map> getMatches() {
        return matches;
    }

    public SearchResponse setMatches(Map> matches) {
        this.matches = matches;
        return this;
    }

    public SearchResponse addMatches(String key, List value) {
        if (this.matches == null)
            this.matches = new java.util.HashMap<>();
        this.matches.put(key, value);
        return this;
    }

    @JsonProperty("Truncations")
    public Map getTruncations() {
        return truncations;
    }

    public SearchResponse setTruncations(Map truncations) {
        this.truncations = truncations;
        return this;
    }

    public SearchResponse addTruncations(String key, boolean value) {
        if (this.truncations == null)
            this.truncations = new java.util.HashMap<>();
        this.truncations.put(key, value);
        return this;
    }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy