Class EquinixRequest<T>

java.lang.Object
com.eqixiac.equinix.core.http.request.EquinixRequest<T>
Direct Known Subclasses:
PaginatedPostRequest, PaginatedRequest

public class EquinixRequest<T> extends Object
Base request type for all Equinix API calls. Concrete and directly instantiable for the simple GET/single/list cases; PaginatedRequest and PaginatedPostRequest extend it to add offset/limit paging and POST-search paging respectively.

The request body - when the operation has one - is carried as a single RequestBody (JSON payload, form fields, or raw bytes); the wire entity is built from it by RequestFactory at dispatch time. No transport (Apache HttpClient) type appears in this class's API.

The type parameter T threads the operation's model type from request construction through EquinixResponse handling; it carries no state on the request itself.

Author:
ianjones
  • Field Details

  • Constructor Details

    • EquinixRequest

      public EquinixRequest()
  • Method Details

    • setQueryParameters

      public void setQueryParameters(Map<String, List<String>> queryParameters)
      Sets the query parameters, defensively deep-copying into a mutable map with mutable value lists. Callers frequently pass immutable maps and lists (Map.of("category", List.of("COLO"))); pagination later mutates the map (adding offset/limit) and addQueryParameter/addSingleQueryParameter append to the value lists, so storing the caller's instances directly would throw UnsupportedOperationException (and alias the caller's collections). This override (in place of Lombok's generated setter) guarantees both levels are always mutable and unaliased.
      Parameters:
      queryParameters - the query parameters (may be null or immutable)
    • setHeaders

      public void setHeaders(Map<String,String> headers)
      Sets the headers, defensively copying into a mutable map (mirrors setQueryParameters(Map): addHeader mutates the stored map, so an immutable caller-supplied map must not be stored by reference).
      Parameters:
      headers - the headers (may be null or immutable)
    • setPathParameters

      public void setPathParameters(Map<String,String> pathParameters)
      Sets the path parameters, defensively copying into a mutable map (mirrors setQueryParameters(Map): addPathParameter mutates the stored map, so an immutable caller-supplied map - e.g. Map.of("uuid", uuid) - must not be stored by reference).
      Parameters:
      pathParameters - the path parameters (may be null or immutable)
    • addHeader

      public void addHeader(String headerName, String headerValue)
    • addQueryParameter

      public void addQueryParameter(String parameterName, List<String> parameterValues)
    • addQueryParameters

      public void addQueryParameters(Map<String, List<String>> parameterValues)
    • replaceQueryParameter

      public void replaceQueryParameter(String parameterName, List<String> parameterValues)
    • addSingleQueryParameter

      public void addSingleQueryParameter(String parameterName, String parameterValue)
    • addPathParameter

      public void addPathParameter(String parameterName, String parameterValue)