Class ApiSignature

java.lang.Object
org.gcube.smartgears.extensions.ApiSignature

public class ApiSignature extends Object
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 Details

    • ApiSignature

      public ApiSignature(String mapping)
      Creates a new API signature for the specified URL mapping.
      Parameters:
      mapping - the URL mapping for this API
  • Method Details

    • with

      public ApiSignature with(ApiMethodSignature signature)
      Adds a method signature to this API signature.
      Parameters:
      signature - the method signature to add
      Returns:
      this signature for method chaining
    • mapping

      public String mapping()
      Returns the URL mapping for this API.
      Returns:
      the URL mapping
    • methods

      public Set<HttpExtension.Method> methods()
      Returns the set of HTTP methods supported by this API.
      Returns:
      the supported HTTP methods
    • requestTypes

      public Map<HttpExtension.Method,Set<String>> requestTypes()
      Returns the request types accepted for each HTTP method.
      Returns:
      a map of HTTP methods to their accepted request types
    • responseTypes

      public Map<HttpExtension.Method,Set<String>> responseTypes()
      Returns the response types produced for each HTTP method.
      Returns:
      a map of HTTP methods to their produced response types