Package com.t4a.predict
Class ShellPredictionLoader
java.lang.Object
com.t4a.predict.ShellPredictionLoader
The
ShellPredictionLoader
class is responsible for loading shell actions from a YAML file
and populating a map of predictions within the application.
This class utilizes the SnakeYAML library for parsing YAML files and provides methods for loading shell actions, parsing their details, and populating a predictions map for further use in the application's predictive capabilities. It handles potential exceptions such as URISyntaxException and IOException during the loading process and utilizes URL resources and input/output streams for seamless access to the YAML file. With its no-args constructor and logging capabilities provided by Lombok annotations, the class ensures robustness and reliability in predicting shell actions within the application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
load
(Map<String, AIAction> predictions, StringBuffer actionNameList, ActionList listOfActions) void
loadYamlFile
(Map<String, AIAction> predictions, StringBuffer actionNameList, ActionList listOfActions)
-
Constructor Details
-
ShellPredictionLoader
public ShellPredictionLoader()
-
-
Method Details
-
load
public void load(Map<String, AIAction> predictions, StringBuffer actionNameList, ActionList listOfActions) throws LoaderException- Throws:
LoaderException
-
loadYamlFile
public void loadYamlFile(Map<String, AIAction> predictions, StringBuffer actionNameList, ActionList listOfActions) throws URISyntaxException- Throws:
URISyntaxException
-