|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codeforamerica.open311.facade.APIWrapperFactory
public class APIWrapperFactory
Builds APIWrapper
instances from different aspects specified by the
user. To set the optional parameters, use the setter methods and, then, call
build()
.
Constructor Summary | |
---|---|
APIWrapperFactory(City city)
Builds an instance from the desired city. |
|
APIWrapperFactory(City city,
EndpointType endpointType)
Builds an instance from the desired city and endpoint type. |
|
APIWrapperFactory(String endpointUrl)
Builds an instance from the endpoint url. |
|
APIWrapperFactory(String endpointUrl,
Format format)
Builds an instance from the endpoint url and the data interchange format. |
|
APIWrapperFactory(String endpointUrl,
String jurisdictionId)
Builds an instance from the endpoint url and the jurisdiction_id. |
|
APIWrapperFactory(String endpointUrl,
String jurisdictionId,
Format format)
Builds an instance from the endpoint url and the jurisdiction_id. |
Method Summary | |
---|---|
APIWrapper |
build()
Builds an APIWrapper . |
APIWrapperFactory |
setApiKey(String apiKey)
Sets the api key. |
APIWrapperFactory |
setCache(Cache cache)
Sets a desired cache system. |
APIWrapperFactory |
setFormat(Format format)
Selects the desired data exchange format. |
APIWrapperFactory |
setNetworkManager(NetworkManager networkManager)
Sets a custom NetworkManager , useful if you need to use mocks or
a platform-dependent network client which you can build implementing the
NetworkManager interface. |
String |
toString()
|
APIWrapperFactory |
withLogs()
The built instance will be logged. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public APIWrapperFactory(String endpointUrl)
endpointUrl
- Url of the endpoint.public APIWrapperFactory(String endpointUrl, String jurisdictionId)
endpointUrl
- Url of the endpoint.jurisdictionId
- Desired jurisdiction_id (can be null
).public APIWrapperFactory(String endpointUrl, Format format)
endpointUrl
- Url of the endpoint.format
- Data format. It is your responsibility to check if the given
format is allowed.public APIWrapperFactory(String endpointUrl, String jurisdictionId, Format format)
endpointUrl
- Url of the endpoint.jurisdictionId
- Desired jurisdiction_id (can be null
).format
- Data format. It is your responsibility to check if the given
format is allowed.public APIWrapperFactory(City city)
EndpointType.PRODUCTION
) and the
format will be Format.XML
.
city
- Desired city.public APIWrapperFactory(City city, EndpointType endpointType)
Format.XML
.
city
- Desired city.endpointType
- Desired endpoint type.Method Detail |
---|
public APIWrapperFactory setFormat(Format format)
format
- Desired format.
public APIWrapperFactory setApiKey(String apiKey)
""
by default.
apiKey
- Api key for the endpoint.
public APIWrapperFactory setNetworkManager(NetworkManager networkManager)
NetworkManager
, useful if you need to use mocks or
a platform-dependent network client which you can build implementing the
NetworkManager
interface.
networkManager
- A implementation of the NetworkManager
interface.
NetworkManager
.public APIWrapperFactory setCache(Cache cache)
cache
- Implementation of the Cache
interface.
Cache
.public APIWrapperFactory withLogs()
public APIWrapper build() throws APIWrapperException
APIWrapper
. WARNING: This operation could
require some time to be done (it could involve network operations).
APIWrapperException
- If there was any problem.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |