Package org.gcube.smartgears.extensions
Class ApiSignature
java.lang.Object
org.gcube.smartgears.extensions.ApiSignature
Represents the complete signature for an API endpoint.
This class aggregates method signatures for different HTTP methods on the same URL mapping.
- Author:
- Luca Frosini (ISTI-CNR)
-
Constructor Summary
ConstructorsConstructorDescriptionApiSignature(String mapping) Creates a new API signature for the specified URL mapping. -
Method Summary
Modifier and TypeMethodDescriptionmapping()Returns the URL mapping for this API.methods()Returns the set of HTTP methods supported by this API.Returns the request types accepted for each HTTP method.Returns the response types produced for each HTTP method.with(ApiMethodSignature signature) Adds a method signature to this API signature.
-
Constructor Details
-
ApiSignature
Creates a new API signature for the specified URL mapping.- Parameters:
mapping- the URL mapping for this API
-
-
Method Details
-
with
Adds a method signature to this API signature.- Parameters:
signature- the method signature to add- Returns:
- this signature for method chaining
-
mapping
Returns the URL mapping for this API.- Returns:
- the URL mapping
-
methods
Returns the set of HTTP methods supported by this API.- Returns:
- the supported HTTP methods
-
requestTypes
Returns the request types accepted for each HTTP method.- Returns:
- a map of HTTP methods to their accepted request types
-
responseTypes
Returns the response types produced for each HTTP method.- Returns:
- a map of HTTP methods to their produced response types
-