Class ResourceMethod
java.lang.Object
com.soklet.ResourceMethod
Represents a Resource Method, which is a Java
Method invoked by Soklet to handle an HTTP request.
Instances can be acquired via the withComponents(HttpMethod, ResourcePathDeclaration, Method, Boolean) factory method.
Detailed documentation available at https://www.soklet.com/docs/request-handling.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns 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}.inthashCode()Returns whether this Resource Method functions as a Server-Sent Event Source.toString()static ResourceMethodwithComponents(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
-
getResourcePathDeclaration
Returns the HTTP path for this Resource Method, which might contain placeholders - for example,/example/{exampleId}.- Returns:
- the HTTP path
-
getMethod
-
isServerSentEventSource
Returns whether this Resource Method functions as a Server-Sent Event Source.- Returns:
trueif this Resource Method functions as a Server-Sent Event Source,falseotherwise
-