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.booleanIs this request a HEAD?booleanIs this request a GET?booleanIs this request a HEAD?booleanIs this request a HEAD?booleanIs this request a POST?booleanIs this request a PUT?
-
Constructor Details
-
RestSupportImpl
public RestSupportImpl(javax.servlet.http.HttpServletRequest request, HttpRequestBodyConverter converter)
-
-
Method Details
-
isHttpGet
Description copied from interface:RestSupportIs this request a GET?- Specified by:
isHttpGetin interfaceRestSupport- Returns:
trueorfalse
-
isHttpPost
Description copied from interface:RestSupportIs this request a POST?- Specified by:
isHttpPostin interfaceRestSupport- Returns:
trueorfalse
-
isHttpHead
Description copied from interface:RestSupportIs this request a HEAD?- Specified by:
isHttpHeadin interfaceRestSupport- Returns:
trueorfalse
-
isHttpPut
Description copied from interface:RestSupportIs this request a PUT?- Specified by:
isHttpPutin interfaceRestSupport- Returns:
trueorfalse
-
isHttpDelete
Description copied from interface:RestSupportIs this request a HEAD?- Specified by:
isHttpDeletein interfaceRestSupport- Returns:
trueorfalse
-
isHttpPatch
Description copied from interface:RestSupportIs this request a HEAD?- Specified by:
isHttpPatchin interfaceRestSupport- Returns:
trueorfalse
-
getRequestBodyAs
Description copied from interface:RestSupportReturns, 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:
getRequestBodyAsin interfaceRestSupport- Type Parameters:
T- the type of the return value.- Parameters:
type- the target type.- Returns:
- an
Optionalwrapping the resulting object.
-