Class McpJsonObject
java.lang.Object
com.soklet.McpJsonObject
- All Implemented Interfaces:
McpJsonValue
An immutable JSON object.
Member names are retained exactly, without normalization or replacement.
Factories and builder setters reject names containing unpaired UTF-16
surrogates with IllegalArgumentException. The independent string/token
and response-size limits described by McpJsonString are checked when
the object is serialized.
- Author:
- Mark Allen
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull McpJsonObject.Builderbuilder()Vends a mutable builder.static @NonNull McpJsonObjectReturns the shared empty object.booleanLooks up a member by name.static @NonNull McpJsonObjectfromMembers(@NonNull Map<@NonNull String, ? extends @NonNull McpJsonValue> members) Creates an object from the supplied members.Returns the immutable members in their original insertion order.inthashCode()
-
Method Details
-
emptyInstance
Returns the shared empty object.- Returns:
- empty JSON object
-
builder
Vends a mutable builder.- Returns:
- JSON object builder
-
fromMembers
public static @NonNull McpJsonObject fromMembers(@NonNull Map<@NonNull String, ? extends @NonNull McpJsonValue> members) Creates an object from the supplied members.- Parameters:
members- object members- Returns:
- immutable JSON object
- Throws:
IllegalArgumentException- if a member name contains an unpaired surrogate
-
getMembers
Returns the immutable members in their original insertion order.- Returns:
- object members in insertion order
-
find
-
equals
-
hashCode
-