Class RestCall

All Implemented Interfaces:
JsonSerializable

public class RestCall extends MethodCall
Represents an extension of a method call. A rest call exists at the service level and represents a call to an endpoint mapping.
  • Field Details

    • url

      private String url
      The URL of the rest call e.g. /api/v1/users/login, May have dynamic parameters which are converted to {?}
    • httpMethod

      private HttpMethod httpMethod
      The httpMethod of the api endpoint e.g. GET, POST, PUT see semantics.models.enums.httpMethod
  • Constructor Details

  • Method Details

    • toJsonObject

      public com.google.gson.JsonObject toJsonObject()
      Specified by:
      toJsonObject in interface JsonSerializable
      Overrides:
      toJsonObject in class MethodCall
      Returns:
      a JsonObject representing this
    • matchEndpoint

      public static boolean matchEndpoint(RestCall restcall, Endpoint endpoint)
      Checks if a rest call matches a given endpoint
      Parameters:
      restcall - rest call to match
      endpoint - endpoint to match
      Returns:
      true if rest call and enpoint match, false otherwise
    • matchQueryParams

      private static boolean matchQueryParams(RestCall restCall, Endpoint endpoint, int queryParamIndex)
      Checks if rest call parameters match parameters for the target endpoint
      Parameters:
      restCall - rest call to match
      endpoint - endpoint to match
      queryParamIndex - string index at which query parameters start
      Returns:
      true if parameters match, false otherwise