Package com.tnsai.mcp.client
Record Class StdioTransport.DisconnectReason
java.lang.Object
java.lang.Record
com.tnsai.mcp.client.StdioTransport.DisconnectReason
- Record Components:
exitCode- the process exit code (-1 if not available)message- human-readable reason descriptioncrashed- true if the disconnect was unexpected (not intentional)commandName- the command that was running
- Enclosing class:
StdioTransport
public static record StdioTransport.DisconnectReason(int exitCode, String message, boolean crashed, String commandName)
extends Record
Reason for a subprocess disconnection.
-
Constructor Summary
ConstructorsConstructorDescriptionDisconnectReason(int exitCode, String message, boolean crashed, String commandName) Creates an instance of aDisconnectReasonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecommandNamerecord component.Creates a crash reason from a process exit.booleancrashed()Returns the value of thecrashedrecord component.final booleanIndicates whether some other object is "equal to" this one.intexitCode()Returns the value of theexitCoderecord component.final inthashCode()Returns a hash code value for this object.healthCheckFailure(String commandName) Creates a disconnect reason for a dead process detected by health check.message()Returns the value of themessagerecord component.streamError(String message, String commandName) Creates a disconnect reason for a stream read failure.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DisconnectReason
Creates an instance of aDisconnectReasonrecord class.- Parameters:
exitCode- the value for theexitCoderecord componentmessage- the value for themessagerecord componentcrashed- the value for thecrashedrecord componentcommandName- the value for thecommandNamerecord component
-
-
Method Details
-
crash
Creates a crash reason from a process exit. -
healthCheckFailure
Creates a disconnect reason for a dead process detected by health check. -
streamError
Creates a disconnect reason for a stream read failure. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
exitCode
public int exitCode()Returns the value of theexitCoderecord component.- Returns:
- the value of the
exitCoderecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
crashed
public boolean crashed()Returns the value of thecrashedrecord component.- Returns:
- the value of the
crashedrecord component
-
commandName
Returns the value of thecommandNamerecord component.- Returns:
- the value of the
commandNamerecord component
-