package de.avatic.lcc.dto.generic;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Represents the various types of nodes that can exist in the system.
 * A node can be categorized as SINK, SOURCE, or INTERMEDIATE, depending
 * on its role within a network or process.
 */
public enum NodeType {
    /**
     * Represents a node that consumes resources or products (end-point of flow).
     */
    DESTINATION("destination"),

    /**
     * Represents a node that originates or provides resources or products for a process.
     */
    SOURCE("source"),

    /**
     * Represents a node that acts as an intermediary in the flow between a source and a sink.
     */
    INTERMEDIATE("intermediate");

    private final String displayedType;

    /**
     * Constructs a NodeType instance with its associated displayed type string.
     *
     * @param displayedType The string representation of the node type.
     */
    NodeType(String displayedType) {
        this.displayedType = displayedType;
    }

    /**
     * Retrieves the string representation of this node type, used for serialization.
     *
     * @return The string representation of the node type.
     */
    @JsonValue
    public String getDisplayedType() {
        return displayedType;
    }


}
