Class McpTextCoordinate

java.lang.Object
com.soklet.McpTextCoordinate

@ThreadSafe public final class McpTextCoordinate extends Object
Immutable stable identity for one framework-owned localizable MCP field.

Coordinates contain registration identity and a deterministic semantic member path, never source or translated text. toExternalKey() returns a versioned representation suitable for an application-owned opaque translation-key strategy.

Author:
Mark Allen
  • Method Details

    • fromComponents

      public static @NonNull McpTextCoordinate fromComponents(@NonNull String endpointPath, @NonNull McpTextOwnerType ownerType, @NonNull String subjectId, @NonNull String memberPath)
      Creates a text coordinate from its structured components.
      Parameters:
      endpointPath - normalized endpoint path
      ownerType - MCP text owner type
      subjectId - stable owner identity within the endpoint
      memberPath - deterministic RFC 6901-escaped semantic member path
      Returns:
      immutable text coordinate
      Throws:
      NullPointerException - if any argument is null
      IllegalArgumentException - if a string argument contains malformed UTF-16
    • getEndpointPath

      Returns:
      normalized endpoint path
    • getOwnerType

      Returns:
      MCP text owner type
    • getSubjectId

      Returns:
      stable owner identity within the endpoint
    • getMemberPath

      Returns:
      deterministic RFC 6901-escaped semantic member path
    • toExternalKey

      Returns the bounded opaque external key soklet-mcp-text-v1.<owner-type-token>.<digest>. The digest is unpadded Base64URL SHA-256 over the ASCII domain soklet-mcp-text-coordinate-v1\0, followed by four UTF-8 components: endpoint path, fixed lowercase owner-type token, subject ID, and member path. Each component is preceded by its four-byte unsigned big-endian byte length. Components are encoded exactly, without normalization or case folding; malformed UTF-16 is rejected when the coordinate is constructed.
      Returns:
      stable versioned opaque translation key
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
      Returns:
      whether every structured coordinate component is equal
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      value-based hash code
    • toString

      Overrides:
      toString in class Object
      Returns:
      coordinate-only rendering that never includes source text