Class RequestScope
- java.lang.Object
-
- com.totvs.tjf.api.request.interceptor.RequestScope
-
public final class RequestScope extends Object
Local thread holder for the current requestRequestScope.Scope
.RequestScope.Scope
consists by theApiGuideline.ApiGuidelineVersion
provided by theRestController
and a list of 'fields' provided by the currentHttpServletRequest
.- Author:
- Thiago A. de Souza Weber
- See Also:
RequestScope.Scope
,ThreadLocal
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection<String>
getExpandables()
Return the list of 'expandables' specified in currentHttpServletRequest
to be serialized.static Collection<String>
getFields()
Return the list of 'fields' specified in currentHttpServletRequest
to be serialized.static com.totvs.tjf.api.context.stereotype.ApiGuideline.ApiGuidelineVersion
getGuidelineVersion()
Return theApiGuideline.ApiGuidelineVersion
specified inRestController
by theApiGuideline
annotation for the currentHttpServletRequest
.static boolean
hasEmptyExpandables()
Checks if this thread process has any 'expand' specified in currentHttpServletRequest
to be serialized.static boolean
hasEmptyFields()
Checks if this thread process has any 'field' specified in currentHttpServletRequest
to be serialized.static boolean
isEmpty()
Checks if this thread process has aRequestScope.Scope
for the currentHttpServletRequest
.static boolean
isError()
Returns if the request contains a error.static void
setError()
Sets if the request contains a error.static boolean
supportsExpand()
Return the expandable support.static boolean
supportsFields()
Return the fields support.
-
-
-
Method Detail
-
isEmpty
public static boolean isEmpty()
Checks if this thread process has aRequestScope.Scope
for the currentHttpServletRequest
.- Returns:
true
if this thread process has aRequestScope.Scope
, otherwise,false
-
hasEmptyFields
public static boolean hasEmptyFields()
Checks if this thread process has any 'field' specified in currentHttpServletRequest
to be serialized.- Returns:
true
if 'fields' list is empty in this thread process, otherwise,false
-
hasEmptyExpandables
public static boolean hasEmptyExpandables()
Checks if this thread process has any 'expand' specified in currentHttpServletRequest
to be serialized.- Returns:
true
if 'expand' list is empty in this thread process, otherwise,false
-
getGuidelineVersion
public static com.totvs.tjf.api.context.stereotype.ApiGuideline.ApiGuidelineVersion getGuidelineVersion()
Return theApiGuideline.ApiGuidelineVersion
specified inRestController
by theApiGuideline
annotation for the currentHttpServletRequest
.- Returns:
ApiGuideline.ApiGuidelineVersion
or null ifRequestScope.Scope
is empty
-
getFields
public static Collection<String> getFields()
Return the list of 'fields' specified in currentHttpServletRequest
to be serialized.- Returns:
- list of 'fields' or null if
RequestScope.Scope
is empty
-
getExpandables
public static Collection<String> getExpandables()
Return the list of 'expandables' specified in currentHttpServletRequest
to be serialized.- Returns:
- list of 'expandables' or null if
RequestScope.Scope
is empty
-
supportsFields
public static boolean supportsFields()
Return the fields support.- Returns:
- true if the current REST endpoint supports fields.
-
supportsExpand
public static boolean supportsExpand()
Return the expandable support.- Returns:
- true if the current REST endpoint supports expandables.
-
isError
public static boolean isError()
Returns if the request contains a error.- Returns:
- true if the request contains a error.
-
setError
public static void setError()
Sets if the request contains a error.
-
-