Package com.wrapper.spotify.requests
Class AbstractRequest<T>
java.lang.Object
com.wrapper.spotify.requests.AbstractRequest<T>
- All Implemented Interfaces:
IRequest<T>
- Direct Known Subclasses:
AbstractAuthorizationRequest,AbstractDataRequest,AuthorizationCodeUriRequest
public abstract class AbstractRequest<T> extends Object implements IRequest<T>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractRequest.Builder<T,BT extends AbstractRequest.Builder<T,?>> -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRequest(AbstractRequest.Builder<T,?> builder) -
Method Summary
Modifier and Type Method Description StringbodyParametersToJson(List<org.apache.hc.core5.http.NameValuePair> bodyParameters)StringdeleteJson()CompletableFuture<T>executeAsync()Get something asynchronously.org.apache.hc.core5.http.HttpEntitygetBody()List<org.apache.hc.core5.http.NameValuePair>getBodyParameters()org.apache.hc.core5.http.ContentTypegetContentType()List<org.apache.hc.core5.http.Header>getHeaders()IHttpManagergetHttpManager()StringgetJson()URIgetUri()voidinitializeBody()StringpostJson()StringputJson()
-
Constructor Details
-
Method Details
-
executeAsync
Get something asynchronously.- Specified by:
executeAsyncin interfaceIRequest<T>- Returns:
- A
CompletableFuturefor a generic.
-
initializeBody
- Throws:
UnsupportedEncodingException
-
bodyParametersToJson
-
getJson
public String getJson() throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseException- Specified by:
getJsonin interfaceIRequest<T>- Throws:
IOExceptionSpotifyWebApiExceptionorg.apache.hc.core5.http.ParseException
-
postJson
public String postJson() throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseException- Specified by:
postJsonin interfaceIRequest<T>- Throws:
IOExceptionSpotifyWebApiExceptionorg.apache.hc.core5.http.ParseException
-
putJson
public String putJson() throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseException- Specified by:
putJsonin interfaceIRequest<T>- Throws:
IOExceptionSpotifyWebApiExceptionorg.apache.hc.core5.http.ParseException
-
deleteJson
public String deleteJson() throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseException- Specified by:
deleteJsonin interfaceIRequest<T>- Throws:
IOExceptionSpotifyWebApiExceptionorg.apache.hc.core5.http.ParseException
-
getHttpManager
- Specified by:
getHttpManagerin interfaceIRequest<T>
-
getUri
-
getHeaders
- Specified by:
getHeadersin interfaceIRequest<T>
-
getContentType
public org.apache.hc.core5.http.ContentType getContentType()- Specified by:
getContentTypein interfaceIRequest<T>
-
getBody
public org.apache.hc.core5.http.HttpEntity getBody() -
getBodyParameters
- Specified by:
getBodyParametersin interfaceIRequest<T>
-