Interface APIResponses

All Superinterfaces:
Constructible, Map<String,APIResponse>

public interface APIResponses extends 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:
  • Field Details

  • Method Details

    • addApiResponse

      APIResponses addApiResponse(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 ApiResponse
      apiResponse - 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