Class AbstractRequest<T>
- java.lang.Object
-
- se.michaelthelin.spotify.requests.AbstractRequest<T>
-
- All Implemented Interfaces:
IRequest<T>
- Direct Known Subclasses:
AbstractAuthorizationRequest,AbstractDataRequest,AuthorizationCodePKCERefreshRequest,AuthorizationCodePKCERequest,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
All Methods Instance Methods Concrete Methods 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 Detail
-
AbstractRequest
protected AbstractRequest(AbstractRequest.Builder<T,?> builder)
-
-
Method Detail
-
executeAsync
public CompletableFuture<T> executeAsync()
Get something asynchronously.- Specified by:
executeAsyncin interfaceIRequest<T>- Returns:
- A
CompletableFuturefor a generic.
-
initializeBody
public void initializeBody()
-
bodyParametersToJson
public String bodyParametersToJson(List<org.apache.hc.core5.http.NameValuePair> bodyParameters)
-
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
public IHttpManager getHttpManager()
- Specified by:
getHttpManagerin interfaceIRequest<T>
-
getHeaders
public List<org.apache.hc.core5.http.Header> 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
public List<org.apache.hc.core5.http.NameValuePair> getBodyParameters()
- Specified by:
getBodyParametersin interfaceIRequest<T>
-
-