Record Class McpCorsContext
java.lang.Object
java.lang.Record
com.soklet.McpCorsContext
@Immutable
public record McpCorsContext(@NonNull Request request, @NonNull Class<? extends McpEndpoint> endpointClass, @NonNull HttpMethod httpMethod, @Nullable String origin, @Nullable String sessionId)
extends Record
Request metadata used by
McpCorsAuthorizer.- Author:
- Mark Allen
-
Constructor Summary
ConstructorsConstructorDescriptionMcpCorsContext(@NonNull Request request, @NonNull Class<? extends McpEndpoint> endpointClass, @NonNull HttpMethod httpMethod, @Nullable String origin, @Nullable String sessionId) Creates an instance of aMcpCorsContextrecord class. -
Method Summary
Modifier and TypeMethodDescription@NonNull Class<? extends McpEndpoint> Returns the value of theendpointClassrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thehttpMethodrecord component.origin()Returns the value of theoriginrecord component.request()Returns the value of therequestrecord component.Returns the value of thesessionIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
McpCorsContext
public McpCorsContext(@NonNull Request request, @NonNull Class<? extends McpEndpoint> endpointClass, @NonNull HttpMethod httpMethod, @Nullable String origin, @Nullable String sessionId) Creates an instance of aMcpCorsContextrecord class.- Parameters:
request- the value for therequestrecord componentendpointClass- the value for theendpointClassrecord componenthttpMethod- the value for thehttpMethodrecord componentorigin- the value for theoriginrecord componentsessionId- the value for thesessionIdrecord component
-
-
Method Details
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
request
-
endpointClass
Returns the value of theendpointClassrecord component.- Returns:
- the value of the
endpointClassrecord component
-
httpMethod
Returns the value of thehttpMethodrecord component.- Returns:
- the value of the
httpMethodrecord component
-
origin
-
sessionId
-