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:
AbstractAthorizationRequest,AbstractDataRequest,AuthorizationCodeUriRequest
public abstract class AbstractRequest<T> extends java.lang.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 java.lang.StringbodyParametersToJson(java.util.List<org.apache.http.NameValuePair> bodyParameters)java.lang.StringdeleteJson()java.util.concurrent.CompletableFuture<T>executeAsync()Get something asynchronously.org.apache.http.HttpEntitygetBody()java.util.List<org.apache.http.NameValuePair>getBodyParameters()org.apache.http.entity.ContentTypegetContentType()java.util.List<org.apache.http.Header>getHeaders()IHttpManagergetHttpManager()java.lang.StringgetJson()java.net.URIgetUri()voidinitializeBody()java.lang.StringpostJson()java.lang.StringputJson()
-
-
-
Constructor Detail
-
AbstractRequest
protected AbstractRequest(AbstractRequest.Builder<T,?> builder)
-
-
Method Detail
-
executeAsync
public java.util.concurrent.CompletableFuture<T> executeAsync()
Get something asynchronously.- Specified by:
executeAsyncin interfaceIRequest<T>- Returns:
- A
CompletableFuturefor a generic.
-
initializeBody
public void initializeBody() throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
bodyParametersToJson
public java.lang.String bodyParametersToJson(java.util.List<org.apache.http.NameValuePair> bodyParameters)
-
getJson
public java.lang.String getJson() throws java.io.IOException, SpotifyWebApiException- Specified by:
getJsonin interfaceIRequest<T>- Throws:
java.io.IOExceptionSpotifyWebApiException
-
postJson
public java.lang.String postJson() throws java.io.IOException, SpotifyWebApiException- Specified by:
postJsonin interfaceIRequest<T>- Throws:
java.io.IOExceptionSpotifyWebApiException
-
putJson
public java.lang.String putJson() throws java.io.IOException, SpotifyWebApiException- Specified by:
putJsonin interfaceIRequest<T>- Throws:
java.io.IOExceptionSpotifyWebApiException
-
deleteJson
public java.lang.String deleteJson() throws java.io.IOException, SpotifyWebApiException- Specified by:
deleteJsonin interfaceIRequest<T>- Throws:
java.io.IOExceptionSpotifyWebApiException
-
getHttpManager
public IHttpManager getHttpManager()
- Specified by:
getHttpManagerin interfaceIRequest<T>
-
getHeaders
public java.util.List<org.apache.http.Header> getHeaders()
- Specified by:
getHeadersin interfaceIRequest<T>
-
getContentType
public org.apache.http.entity.ContentType getContentType()
- Specified by:
getContentTypein interfaceIRequest<T>
-
getBodyParameters
public java.util.List<org.apache.http.NameValuePair> getBodyParameters()
- Specified by:
getBodyParametersin interfaceIRequest<T>
-
-