Class DiagnosticIssue

java.lang.Object
neqsim.mcp.model.DiagnosticIssue

public class DiagnosticIssue extends Object
A diagnostic issue found during validation or simulation.

Unifies the issue format used by Validator.Issue and SimulationResult.ErrorDetail into a single model for MCP responses. Each issue has a severity, machine-readable code, human-readable message, and an optional remediation hint.

Version:
1.0
Author:
Even Solbraa
  • Field Details

    • severity

      private final String severity
    • code

      private final String code
    • message

      private final String message
    • remediation

      private final String remediation
  • Constructor Details

    • DiagnosticIssue

      public DiagnosticIssue(String severity, String code, String message, String remediation)
      Creates a diagnostic issue.
      Parameters:
      severity - "error" or "warning"
      code - machine-readable issue code (e.g., "UNKNOWN_COMPONENT")
      message - human-readable description
      remediation - how to fix the issue, or null
  • Method Details

    • error

      public static DiagnosticIssue error(String code, String message, String remediation)
      Creates an error-level issue.
      Parameters:
      code - the issue code
      message - the description
      remediation - how to fix
      Returns:
      the issue
    • warning

      public static DiagnosticIssue warning(String code, String message, String remediation)
      Creates a warning-level issue.
      Parameters:
      code - the issue code
      message - the description
      remediation - how to fix
      Returns:
      the issue
    • getSeverity

      public String getSeverity()
      Gets the severity level.
      Returns:
      "error" or "warning"
    • getCode

      public String getCode()
      Gets the machine-readable issue code.
      Returns:
      the code
    • getMessage

      public String getMessage()
      Gets the human-readable message.
      Returns:
      the message
    • getRemediation

      public String getRemediation()
      Gets the remediation hint.
      Returns:
      the remediation, or null
    • isError

      public boolean isError()
      Returns true if this is an error-level issue.
      Returns:
      true if severity is "error"
    • toJson

      public com.google.gson.JsonObject toJson()
      Converts this issue to a JsonObject.
      Returns:
      JSON representation
    • toString

      public String toString()
      Overrides:
      toString in class Object