Interface APIResponses
- All Superinterfaces:
Constructible
,Map<String,
APIResponse>
This interface represents the container for the expected responses of an operation. The container maps a HTTP response code to the expected
response.
- See Also:
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddApiResponse
(String name, APIResponse apiResponse) Adds an ApiResponse in the format of the name as a key and the item as the value to ApiResponses mapdefaultValue
(APIResponse defaultValue) Sets the default documentation of responses for this instance of ApiResponses and return this instance of ApiResponses.Returns the default documentation of responses other than the ones declared for specific HTTP response codes in this instance of ApiResponses.void
setDefaultValue
(APIResponse defaultValue) Sets the default documentation of responses for this instance of ApiResponses.Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Field Details
-
DEFAULT
- See Also:
-
-
Method Details
-
addApiResponse
Adds an ApiResponse in the format of the name as a key and the item as the value to ApiResponses map- Parameters:
name
- the name of ApiResponseapiResponse
- the ApiResponse object to be added to ApiResponses map- Returns:
- ApiResponses map with the added ApiResponse instance
-
getDefault
APIResponse getDefault()Returns the default documentation of responses other than the ones declared for specific HTTP response codes in this instance of ApiResponses.- Returns:
- the default documentation of responses
-
setDefaultValue
Sets the default documentation of responses for this instance of ApiResponses. This will cover all the undeclared responses.- Parameters:
defaultValue
- the default documentation of responses
-
defaultValue
Sets the default documentation of responses for this instance of ApiResponses and return this instance of ApiResponses. This will cover all the undeclared responses.- Parameters:
defaultValue
- the default documentation of responses- Returns:
- this ApiResponses instance
-