Interface Callback
-
- All Superinterfaces:
Constructible
,Extensible<Callback>
,java.util.Map<java.lang.String,PathItem>
,Reference<Callback>
public interface Callback extends Constructible, Extensible<Callback>, Reference<Callback>, java.util.Map<java.lang.String,PathItem>
CallbackA map of possible out-of-band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
- See Also:
- OpenAPI Specification Callback Object
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Callback
addPathItem(java.lang.String name, PathItem pathItem)
Adds the given PathItem to this Callback's list of PathItems using the string as its key.boolean
containsKey(java.lang.Object key)
Deprecated.since 1.1PathItem
get(java.lang.Object key)
Deprecated.since 1.1default PathItem
getPathItem(java.lang.String name)
Returns a path item for a given name.java.util.Map<java.lang.String,PathItem>
getPathItems()
Returns a copy map (potentially immutable) of the path items.default boolean
hasPathItem(java.lang.String name)
Check whether a path item is present to the map.PathItem
put(java.lang.String key, PathItem value)
Deprecated.since 1.1void
putAll(java.util.Map<? extends java.lang.String,? extends PathItem> m)
Deprecated.since 1.1PathItem
remove(java.lang.Object key)
Deprecated.since 1.1void
removePathItem(java.lang.String name)
Removes the given path item of the Callback PathItems.void
setPathItems(java.util.Map<java.lang.String,PathItem> items)
Set the path items map to this Callback.-
Methods inherited from interface org.eclipse.microprofile.openapi.models.Extensible
addExtension, extensions, getExtensions, removeExtension, setExtensions
-
-
-
-
Method Detail
-
addPathItem
Callback addPathItem(java.lang.String name, PathItem pathItem)
Adds the given PathItem to this Callback's list of PathItems using the string as its key. The key that identifies the Path Item Object is a runtime expression that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request. A simple example might be $request.body#/url. However, using a runtime expression the complete HTTP message can be accessed. This includes accessing any part of a body that a JSON Pointer RFC6901 can reference.- Parameters:
name
- a runtime expression that can be evaluated in the context of a runtime HTTP request/responsepathItem
- a path to add to this Callback's list of PathItems. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- the current Callback instance
-
removePathItem
void removePathItem(java.lang.String name)
Removes the given path item of the Callback PathItems.- Parameters:
name
- a path name that will be removed.
-
getPathItems
java.util.Map<java.lang.String,PathItem> getPathItems()
Returns a copy map (potentially immutable) of the path items.- Returns:
- all items
-
setPathItems
void setPathItems(java.util.Map<java.lang.String,PathItem> items)
Set the path items map to this Callback.- Parameters:
items
- a map containing the list of paths.
-
hasPathItem
default boolean hasPathItem(java.lang.String name)
Check whether a path item is present to the map. This is a convenience method forgetPathItems().containsKey(name)
- Parameters:
name
- a path name in the format valid for a Paths object.- Returns:
- a boolean to indicate if the path item is present or not.
-
getPathItem
default PathItem getPathItem(java.lang.String name)
Returns a path item for a given name. This is a convenience method forgetPathItems().get(name)
- Parameters:
name
- a path name in the format valid for a Paths object.- Returns:
- the corresponding path item or null.
-
get
@Deprecated PathItem get(java.lang.Object key)
Deprecated.since 1.1In the next version,Callback
will no longer extendsMap
, this method will no longer be present. UsegetPathItem(String)
instead.- Specified by:
get
in interfacejava.util.Map<java.lang.String,PathItem>
-
containsKey
@Deprecated boolean containsKey(java.lang.Object key)
Deprecated.since 1.1In the next version,Callback
will no longer extendsMap
, this method will no longer be present. UsehasPathItem(String)
instead.- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,PathItem>
-
put
@Deprecated PathItem put(java.lang.String key, PathItem value)
Deprecated.since 1.1In the next version,Callback
will no longer extendsMap
, this method will no longer be present. UseaddPathItem(String, PathItem)
instead.- Specified by:
put
in interfacejava.util.Map<java.lang.String,PathItem>
-
putAll
@Deprecated void putAll(java.util.Map<? extends java.lang.String,? extends PathItem> m)
Deprecated.since 1.1In the next version,Callback
will no longer extendsMap
, this method will no longer be present. UsesetPathItems(Map)
instead.- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,PathItem>
-
remove
@Deprecated PathItem remove(java.lang.Object key)
Deprecated.since 1.1In the next version,Callback
will no longer extendsMap
, this method will no longer be present. UseremovePathItem(String)
instead.- Specified by:
remove
in interfacejava.util.Map<java.lang.String,PathItem>
-
-