Class EverSdkContext.Builder

java.lang.Object
tech.deplant.java4ever.binding.EverSdkContext.Builder
Enclosing class:
EverSdkContext

public static class EverSdkContext.Builder extends Object
Builder to correctly request and create Context object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setConfigJson

      public EverSdkContext.Builder setConfigJson(String configJson)
    • setTimeout

      public EverSdkContext.Builder setTimeout(long timeout)
      Sets timeout for EVER-SDK responses
      Parameters:
      timeout - Response completion waiting timeout (in milliseconds)
      Returns:
      instance of builder
    • setMapper

      public EverSdkContext.Builder setMapper(com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
    • buildFromExisting

      public EverSdkContext buildFromExisting(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. 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-SDK
      existingContextRequestCount - last request number of previously created Context in EVER-SDK
      Returns:
      Context object made of provided data
    • buildNew

      public EverSdkContext 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
    • buildNew

      public EverSdkContext buildNew() throws com.fasterxml.jackson.core.JsonProcessingException
      Terminal builder method to create new Context. Uses default loader with EVER-SDK for autodetected OS invalid input: '&' processor arch.
      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