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

fi.evolver.basics.spring.status.model.ComponentStatus Maven / Gradle / Ivy

package fi.evolver.basics.spring.status.model;

import java.util.Map;


public class ComponentStatus {
    private final String type;
    private final String name;
    private final Map properties;


    /**
     * Creates a new status report for a single component.
     *
     * @param type The component's type
     * @param name the component's unique name
     * @param properties The component's current status
     */
    public ComponentStatus(String type, String name, Map properties) {
        this.type = type;
        this.name = name;
        this.properties = properties;
    }


    public String getName() {
        return name;
    }

    public Map getProperties() {
        return properties;
    }

    public String getType() {
        return type;
    }


    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append(type).append(" ").append(name);
        properties.forEach((k, v) ->
                builder.append("\n\t").append(k).append(": ").append(v));
        return builder.toString();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy