Interface RestSupport
-
- All Known Implementing Classes:
RestSupportImpl
public interface RestSupport
Service which provides REST-related utilities.- Since:
- 5.8.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> java.util.Optional<T>getRequestBodyAs(java.lang.Class<T> type)Returns, if present, the body of the request body coerced to a given type.booleanisHttpDelete()Is this request a HEAD?booleanisHttpGet()Is this request a GET?booleanisHttpHead()Is this request a HEAD?booleanisHttpPatch()Is this request a HEAD?booleanisHttpPost()Is this request a POST?booleanisHttpPut()Is this request a PUT?
-
-
-
Method Detail
-
isHttpGet
boolean isHttpGet()
Is this request a GET?- Returns:
trueorfalse
-
isHttpPost
boolean isHttpPost()
Is this request a POST?- Returns:
trueorfalse
-
isHttpHead
boolean isHttpHead()
Is this request a HEAD?- Returns:
trueorfalse
-
isHttpPut
boolean isHttpPut()
Is this request a PUT?- Returns:
trueorfalse
-
isHttpDelete
boolean isHttpDelete()
Is this request a HEAD?- Returns:
trueorfalse
-
isHttpPatch
boolean isHttpPatch()
Is this request a HEAD?- Returns:
trueorfalse
-
getRequestBodyAs
<T> java.util.Optional<T> getRequestBodyAs(java.lang.Class<T> type)
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).- Type Parameters:
T- the type of the return value.- Parameters:
type- the target type.- Returns:
- an
Optionalwrapping the resulting object.
-
-