Interface APIResponses
-
- All Superinterfaces:
Constructible
,java.util.Map<java.lang.String,APIResponse>
public interface APIResponses extends Constructible, java.util.Map<java.lang.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:
- Responses Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description APIResponses
addApiResponse(java.lang.String name, APIResponse apiResponse)
Adds an ApiResponse in the format of the name as a key and the item as the value to ApiResponses mapAPIResponses
defaultValue(APIResponse defaultValue)
Sets the default documentation of responses for this instance of ApiResponses and return this instance of ApiResponses.APIResponse
getDefault()
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, entry, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, of, of, of, of, of, of, of, of, of, of, of, ofEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Field Detail
-
DEFAULT
static final java.lang.String DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
addApiResponse
APIResponses addApiResponse(java.lang.String name, APIResponse apiResponse)
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
void setDefaultValue(APIResponse defaultValue)
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
APIResponses defaultValue(APIResponse 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
-
-