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