Interface Extensible<T extends Extensible<T>>
-
- All Known Subinterfaces:
APIResponse
,APIResponses
,Callback
,Components
,Contact
,Encoding
,Example
,ExternalDocumentation
,Header
,Info
,License
,Link
,MediaType
,OAuthFlow
,OAuthFlows
,OpenAPI
,Operation
,Parameter
,PathItem
,Paths
,RequestBody
,Schema
,Scopes
,SecurityScheme
,Server
,ServerVariable
,ServerVariables
,Tag
,XML
public interface Extensible<T extends Extensible<T>>
The base interface for OpenAPI model objects that can contain extensions. Extensions contain data not required by the specification and may or may not be supported by the tools you use.The extensions property names are always prefixed by "x-".
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
addExtension(java.lang.String name, java.lang.Object value)
Adds the given object to this Extensible's map of extensions, with the given name as its key.default T
extensions(java.util.Map<java.lang.String,java.lang.Object> extensions)
Sets this Extensible's extensions property to the given map of extensions.java.util.Map<java.lang.String,java.lang.Object>
getExtensions()
Returns the extensions property from an Extensible instance.void
removeExtension(java.lang.String name)
Removes the given object to this Extensible's map of extensions, with the given name as its key.void
setExtensions(java.util.Map<java.lang.String,java.lang.Object> extensions)
Sets this Extensible's extensions property to the given map of extensions.
-
-
-
Method Detail
-
getExtensions
java.util.Map<java.lang.String,java.lang.Object> getExtensions()
Returns the extensions property from an Extensible instance.- Returns:
- a map containing keys which start with "x-" and values which provide additional information
-
extensions
default T extensions(java.util.Map<java.lang.String,java.lang.Object> extensions)
Sets this Extensible's extensions property to the given map of extensions.- Parameters:
extensions
- map containing keys which start with "x-" and values which provide additional information- Returns:
- the current instance
-
addExtension
T addExtension(java.lang.String name, java.lang.Object value)
Adds the given object to this Extensible's map of extensions, with the given name as its key.- Parameters:
name
- the key used to access the extension object. Always prefixed by "x-".value
- data not required by the specification. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- the current instance
-
removeExtension
void removeExtension(java.lang.String name)
Removes the given object to this Extensible's map of extensions, with the given name as its key.- Parameters:
name
- the key used to access the extension object. Always prefixed by "x-".
-
setExtensions
void setExtensions(java.util.Map<java.lang.String,java.lang.Object> extensions)
Sets this Extensible's extensions property to the given map of extensions.- Parameters:
extensions
- map containing keys which start with "x-" and values which provide additional information
-
-