Package com.techcognita.javachatx.api
Class BaseApiConnector
java.lang.Object
com.techcognita.javachatx.api.BaseApiConnector
- All Implemented Interfaces:
ApiConnector
- Direct Known Subclasses:
EchoApiConnector
Base implementation of the ApiConnector interface.
Provides common functionality for all API connectors.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.google.gson.JsonObjectprotected Stringprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(com.google.gson.JsonObject configuration) Configure the API connector with necessary credentials and settings.getName()Get the name of this API connector.booleanisReady()Check if the connector is properly configured and ready to use.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.techcognita.javachatx.api.ApiConnector
sendRequest
-
Field Details
-
name
-
configuration
protected com.google.gson.JsonObject configuration -
ready
protected boolean ready
-
-
Constructor Details
-
BaseApiConnector
-
-
Method Details
-
getName
Description copied from interface:ApiConnectorGet the name of this API connector.- Specified by:
getNamein interfaceApiConnector- Returns:
- The connector name
-
isReady
public boolean isReady()Description copied from interface:ApiConnectorCheck if the connector is properly configured and ready to use.- Specified by:
isReadyin interfaceApiConnector- Returns:
- true if the connector is ready, false otherwise
-
configure
public void configure(com.google.gson.JsonObject configuration) Description copied from interface:ApiConnectorConfigure the API connector with necessary credentials and settings.- Specified by:
configurein interfaceApiConnector- Parameters:
configuration- The configuration parameters as a JSON object
-
toString
-