java.lang.Object
tech.deplant.java4ever.binding.ContextBuilder
Builder to correctly request and create Context object
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.fasterxml.jackson.databind.ObjectMapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildFromExisting
(int existingContextId, int existingContextRequestCount) If you, for some reason, can't directly access already created Context object, but you're sure that it is created, loaded and you know it's id and last request count, you should use this method to load Context object out of this data.buildNew
(LibraryLoader loader) Terminal builder method to create new ContextsetConfigJson
(String configJson) setMapper
(com.fasterxml.jackson.databind.ObjectMapper jsonMapper) setTimeout
(long timeout) Sets timeout for EVER-SDK responses
-
Field Details
-
DEFAULT_MAPPER
public static final com.fasterxml.jackson.databind.ObjectMapper DEFAULT_MAPPER
-
-
Constructor Details
-
ContextBuilder
public ContextBuilder()
-
-
Method Details
-
setConfigJson
-
setTimeout
Sets timeout for EVER-SDK responses- Parameters:
timeout
- Response completion waiting timeout (in milliseconds)- Returns:
- instance of builder
-
setMapper
-
buildFromExisting
If you, for some reason, can't directly access already created Context object, but you're sure that it is created, loaded and you know it's id and last request count, you should use this method to load Context object out of this data. It's up to you if id and request count are correct, it will not be checked until you start calls with Context.- Parameters:
existingContextId
- id of existing, previously created Context in EVER-SDKexistingContextRequestCount
- last request number of previously created Context in EVER-SDK- Returns:
- Context object made of provided data
-
buildNew
public Context buildNew(LibraryLoader loader) throws com.fasterxml.jackson.core.JsonProcessingException Terminal builder method to create new Context- Parameters:
loader
- Specify how exactly ton_client library will be found and loaded- Returns:
- Context object that can be used in calls to EVER-SDK, ton_client library is loaded and called in the process
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-