Class EquinixRequest<T>
java.lang.Object
com.eqixiac.equinix.core.http.request.EquinixRequest<T>
- Direct Known Subclasses:
PaginatedPostRequest, PaginatedRequest
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddPathParameter(String parameterName, String parameterValue) voidaddQueryParameter(String parameterName, List<String> parameterValues) voidaddQueryParameters(Map<String, List<String>> parameterValues) voidaddSingleQueryParameter(String parameterName, String parameterValue) voidreplaceQueryParameter(String parameterName, List<String> parameterValues) voidsetHeaders(Map<String, String> headers) Sets the headers, defensively copying into a mutable map (mirrorssetQueryParameters(Map):addHeadermutates the stored map, so an immutable caller-supplied map must not be stored by reference).voidsetPathParameters(Map<String, String> pathParameters) Sets the path parameters, defensively copying into a mutable map (mirrorssetQueryParameters(Map):addPathParametermutates the stored map, so an immutable caller-supplied map - e.g.voidsetQueryParameters(Map<String, List<String>> queryParameters) Sets the query parameters, defensively deep-copying into a mutable map with mutable value lists.
-
Field Details
-
queryParameters
-
-
Constructor Details
-
EquinixRequest
public EquinixRequest()
-
-
Method Details
-
setQueryParameters
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 (addingoffset/limit) andaddQueryParameter/addSingleQueryParameterappend to the value lists, so storing the caller's instances directly would throwUnsupportedOperationException(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 benullor immutable)
-
setHeaders
Sets the headers, defensively copying into a mutable map (mirrorssetQueryParameters(Map):addHeadermutates the stored map, so an immutable caller-supplied map must not be stored by reference).- Parameters:
headers- the headers (may benullor immutable)
-
setPathParameters
Sets the path parameters, defensively copying into a mutable map (mirrorssetQueryParameters(Map):addPathParametermutates 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 benullor immutable)
-
addHeader
-
addQueryParameter
-
addQueryParameters
-
replaceQueryParameter
-
addSingleQueryParameter
-
addPathParameter
-