Class RestSupportImpl
java.lang.Object
org.apache.tapestry5.http.internal.services.RestSupportImpl
- All Implemented Interfaces:
RestSupport
Default RestSupport implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionRestSupportImpl
(javax.servlet.http.HttpServletRequest request, HttpRequestBodyConverter converter) -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T>
getRequestBodyAs
(Class<T> type) Returns, if present, the body of the request body coerced to a given type.boolean
Is this request a HEAD?boolean
Is this request a GET?boolean
Is this request a HEAD?boolean
Is this request a HEAD?boolean
Is this request a POST?boolean
Is this request a PUT?
-
Constructor Details
-
RestSupportImpl
public RestSupportImpl(javax.servlet.http.HttpServletRequest request, HttpRequestBodyConverter converter)
-
-
Method Details
-
isHttpGet
Description copied from interface:RestSupport
Is this request a GET?- Specified by:
isHttpGet
in interfaceRestSupport
- Returns:
true
orfalse
-
isHttpPost
Description copied from interface:RestSupport
Is this request a POST?- Specified by:
isHttpPost
in interfaceRestSupport
- Returns:
true
orfalse
-
isHttpHead
Description copied from interface:RestSupport
Is this request a HEAD?- Specified by:
isHttpHead
in interfaceRestSupport
- Returns:
true
orfalse
-
isHttpPut
Description copied from interface:RestSupport
Is this request a PUT?- Specified by:
isHttpPut
in interfaceRestSupport
- Returns:
true
orfalse
-
isHttpDelete
Description copied from interface:RestSupport
Is this request a HEAD?- Specified by:
isHttpDelete
in interfaceRestSupport
- Returns:
true
orfalse
-
isHttpPatch
Description copied from interface:RestSupport
Is this request a HEAD?- Specified by:
isHttpPatch
in interfaceRestSupport
- Returns:
true
orfalse
-
getRequestBodyAs
Description copied from interface:RestSupport
Returns, if present, the body of the request body coerced to a given type. If the body is empty, an empty Optional is returned. Coercions are done through, which uses TypeCoercer as a fallback (coercing HttpServletRequest to the target type).- Specified by:
getRequestBodyAs
in interfaceRestSupport
- Type Parameters:
T
- the type of the return value.- Parameters:
type
- the target type.- Returns:
- an
Optional
wrapping the resulting object.
-