Class BaseApiConnector

java.lang.Object
com.techcognita.javachatx.api.BaseApiConnector
All Implemented Interfaces:
ApiConnector
Direct Known Subclasses:
EchoApiConnector

public abstract class BaseApiConnector extends Object implements ApiConnector
Base implementation of the ApiConnector interface. Provides common functionality for all API connectors.
  • Field Details

    • name

      protected String name
    • configuration

      protected com.google.gson.JsonObject configuration
    • ready

      protected boolean ready
  • Constructor Details

    • BaseApiConnector

      public BaseApiConnector(String name)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: ApiConnector
      Get the name of this API connector.
      Specified by:
      getName in interface ApiConnector
      Returns:
      The connector name
    • isReady

      public boolean isReady()
      Description copied from interface: ApiConnector
      Check if the connector is properly configured and ready to use.
      Specified by:
      isReady in interface ApiConnector
      Returns:
      true if the connector is ready, false otherwise
    • configure

      public void configure(com.google.gson.JsonObject configuration)
      Description copied from interface: ApiConnector
      Configure the API connector with necessary credentials and settings.
      Specified by:
      configure in interface ApiConnector
      Parameters:
      configuration - The configuration parameters as a JSON object
    • toString

      public String toString()
      Overrides:
      toString in class Object