Class AbstractRebrickableService
- java.lang.Object
-
- org.dajlab.rebrickableapi.v3.service.AbstractRebrickableService
-
- All Implemented Interfaces:
IService
- Direct Known Subclasses:
ElementsServiceImpl,SetsServiceImpl
public abstract class AbstractRebrickableService extends Object implements IService
Abstract service.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRebrickableService(String privateKey)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringreturnJsonResponse(Method method, String uri)Call the service and return the response.protected StringreturnJsonResponse(Method method, String uri, Map<String,String> parameters)Call the service and return the response.voidsetKey(String key)
-
-
-
Constructor Detail
-
AbstractRebrickableService
protected AbstractRebrickableService(String privateKey)
Constructor.- Parameters:
privateKey- your Rebrickable private key.
-
-
Method Detail
-
returnJsonResponse
protected String returnJsonResponse(Method method, String uri) throws RebrickableException
Call the service and return the response.- Parameters:
method- http methodeuri- uri- Returns:
- the string representation of the JSON response
- Throws:
RebrickableException- exception
-
returnJsonResponse
protected String returnJsonResponse(Method method, String uri, Map<String,String> parameters) throws RebrickableException
Call the service and return the response.- Parameters:
method- http methodeuri- uriparameters- request parameters- Returns:
- the string representation of the JSON response
- Throws:
RebrickableException- exception
-
-