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

io.quarkiverse.nagios.health.NagiosValueResult Maven / Gradle / Ivy

package io.quarkiverse.nagios.health;

import java.util.*;

public record NagiosValueResult(
        String name,
        Object value,
        NagiosStatus status,
        Map data

) implements NagiosCheckResult {

    public NagiosValueResult(String name, NagiosStatus status, Map data) {
        this(name, status, status, data);
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public NagiosStatus getNagiosStatus() {
        return status;
    }

    @Override
    public StringBuilder describeResult(StringBuilder sb) {
        return sb.append(name).append(": ").append(value);
    }

    @Override
    public StringBuilder describeStatus(StringBuilder sb) {
        if (value == status) {
            return sb.append(status);
        }
        return sb.append(value).append(" [").append(status).append("]");
    }

    @Override
    public Map getData() {
        return data;
    }

    @Override
    public List getPerformanceValues() {
        return List.of();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy