Class McpJsonString
java.lang.Object
com.soklet.McpJsonString
- All Implemented Interfaces:
McpJsonValue
An immutable JSON string.
Construction rejects unpaired UTF-16 surrogates with
IllegalArgumentException and retains well-formed text exactly,
without normalization or replacement. It does not guarantee that the
value can be sent on the MCP wire. Production JSON independently limits
decoded strings and their escaped tokens to 1,048,576 UTF-16 code units,
excluding the surrounding quotes. For example, each newline consumes one
decoded unit but two token units. Object member names have the same limits.
The complete response is also limited to 4 MiB of UTF-8 JSON.
- Author:
- Mark Allen
-
Method Summary
-
Method Details
-
fromValue
Creates an immutable JSON string from its value.- Parameters:
value- the non-null string value- Returns:
- immutable JSON string
- Throws:
IllegalArgumentException- if the value contains an unpaired surrogate
-
getValue
-
equals
-
hashCode
-
toString
-