public interface APIResponses extends Constructible, Extensible<APIResponses>, Map<String,APIResponse>
Modifier and Type | Method and Description |
---|---|
default APIResponses |
addApiResponse(String name,
APIResponse apiResponse)
Deprecated.
since 1.1, use
addAPIResponse(String, APIResponse) instead |
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
|
boolean |
containsKey(Object key)
Deprecated.
since 1.1
|
default APIResponses |
defaultValue(APIResponse defaultValue)
Sets the default documentation of responses for this instance of ApiResponses and return this instance of ApiResponses.
|
APIResponse |
get(Object key)
Deprecated.
since 1.1
|
default APIResponse |
getAPIResponse(String name)
Returns a APIResponse for a given name.
|
Map<String,APIResponse> |
getAPIResponses()
Returns a copy map (potentially immutable) of the APIResponses.
|
default APIResponse |
getDefault()
Deprecated.
since 1.1, use @link
getDefaultValue() instead |
APIResponse |
getDefaultValue()
Returns the default documentation of responses other than the ones declared for specific HTTP response codes in this instance of ApiResponses.
|
default boolean |
hasAPIResponse(String name)
Check whether a APIResponse is present in the map.
|
APIResponse |
put(String key,
APIResponse value)
Deprecated.
since 1.1
|
void |
putAll(Map<? extends String,? extends APIResponse> m)
Deprecated.
since 1.1
|
APIResponse |
remove(Object key)
Deprecated.
since 1.1
|
void |
removeAPIResponse(String name)
Removes the given APIResponse to this APIResponses.
|
void |
setAPIResponses(Map<String,APIResponse> items)
Set the APIResponses map to this APIResponses
|
void |
setDefaultValue(APIResponse defaultValue)
Sets the default documentation of responses for this instance of ApiResponses.
|
addExtension, extensions, getExtensions, removeExtension, setExtensions
clear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
static final String DEFAULT
@Deprecated default APIResponses addApiResponse(String name, APIResponse apiResponse)
addAPIResponse(String, APIResponse)
insteadname
- the name of APIResponse (http status code eventually with wildcard or "default")apiResponse
- the APIResponse object to be added to APIResponses map. null values will be rejected (implementation will throw an
exception) or ignored.APIResponses addAPIResponse(String name, APIResponse apiResponse)
name
- the name of APIResponse (http status code eventually with wildcard or "default")apiResponse
- the APIResponse object to be added to APIResponses map. null values will be rejected (implementation will throw an
exception) or ignored.void removeAPIResponse(String name)
name
- the name of APIResponse that will be removed (http status code eventually with wildcard or "default")Map<String,APIResponse> getAPIResponses()
void setAPIResponses(Map<String,APIResponse> items)
items
- a map containing all responses. Keys are http statuses code eventually with wildcard or "default".default boolean hasAPIResponse(String name)
getAPIResponses().containsKey(name)
name
- the name of APIResponse (http status code eventually with wildcard or "default")default APIResponse getAPIResponse(String name)
getAPIResponses().get(name)
name
- the name of APIResponse (http status code eventually with wildcard or "default")@Deprecated APIResponse get(Object key)
APIResponses
will no longer extends Map
, this method will no longer be present.
Use getAPIResponse(String)
instead.get
in interface Map<String,APIResponse>
@Deprecated boolean containsKey(Object key)
APIResponses
will no longer extends Map
, this method will no longer be present.
Use hasAPIResponse(String)
instead.containsKey
in interface Map<String,APIResponse>
@Deprecated APIResponse put(String key, APIResponse value)
APIResponses
will no longer extends Map
, this method will no longer be present.
Use addAPIResponse(String, APIResponse)
instead.put
in interface Map<String,APIResponse>
@Deprecated void putAll(Map<? extends String,? extends APIResponse> m)
APIResponses
will no longer extends Map
, this method will no longer be present.
Use setAPIResponses(Map)
instead.putAll
in interface Map<String,APIResponse>
@Deprecated APIResponse remove(Object key)
APIResponses
will no longer extends Map
, this method will no longer be present.
Use removeAPIResponse(String)
instead.remove
in interface Map<String,APIResponse>
@Deprecated default APIResponse getDefault()
getDefaultValue()
instead
Convenience method that is the same as calling get(Object)
on the map with "default" as value for the key.
APIResponse getDefaultValue()
Convenience method that is the same as calling get(Object)
on the map with "default" as value for the key.
void setDefaultValue(APIResponse defaultValue)
Convenience method that is the same as calling addAPIResponse(String, APIResponse)
with "default" as value for the key.
defaultValue
- the default documentation of responsesdefault APIResponses defaultValue(APIResponse defaultValue)
Convenience method that is the same as calling addAPIResponse(String, APIResponse)
with "default" as value for the key.
defaultValue
- the default documentation of responsesCopyright © 2017 – 2021 Eclipse Foundation. All rights reserved.
Use is subject to license terms.