Class ResourceMethod
java.lang.Object
com.soklet.core.ResourceMethod
Represents a Resource Method, which is a Java
Method
invoked by Soklet to handle an HTTP request.
See https://www.soklet.com/docs/request-handling for details.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the HTTP method for this Resource Method.Returns the Java method to invoke for the combination of HTTP method and resource path.Returns the HTTP path for this Resource Method, which might contain placeholders - for example,/example/{exampleId}
.int
hashCode()
Returns whether or not this Resource Method functions as a Server-Sent Event Source.toString()
static ResourceMethod
withComponents
(HttpMethod httpMethod, ResourcePathDeclaration resourcePathDeclaration, Method method, Boolean serverSentEventSource) Vends a Resource Method given its unique components.
-
Method Details
-
withComponents
@Nonnull public static ResourceMethod withComponents(@Nonnull HttpMethod httpMethod, @Nonnull ResourcePathDeclaration resourcePathDeclaration, @Nonnull Method method, @Nonnull Boolean serverSentEventSource) Vends a Resource Method given its unique components.- Parameters:
httpMethod
- an HTTP methodresourcePathDeclaration
- an HTTP path which might contain placeholders, e.g./example/{exampleId}
method
- a Java method to invoke for the combination of HTTP method and resource pathserverSentEventSource
- is this Resource Method configured as a server-sent event source?- Returns:
- a Resource Method for the supplied components
-
toString
-
equals
-
hashCode
-
getHttpMethod
Returns the HTTP method for this Resource Method.- Returns:
- the HTTP method
-
getResourcePath
Returns the HTTP path for this Resource Method, which might contain placeholders - for example,/example/{exampleId}
.- Returns:
- the HTTP path
-
getMethod
-
isServerSentEventSource
Returns whether or not this Resource Method functions as a Server-Sent Event Source.- Returns:
true
if this Resource Method functions as a Server-Sent Event Source,false
otherwise
-