Class Skill

java.lang.Object
mindsdb.models.skill.Skill
Direct Known Subclasses:
RetrievalSkill, SQLSkill

public class Skill extends Object
The Skill class represents a skill with a name, type, and parameters. It provides constructors for creating a skill instance and methods for converting JSON data to a Skill object. Attributes:
  • name: The name of the skill.
  • type: The type of the skill.
  • params: The parameters of the skill.
Methods:
  • Skill(String name, String type, Map<String, Object> params): Constructs a new Skill instance with the specified name, type, and parameters.
  • static Skill fromJson(JsonObject json): Converts JSON data to a Skill object.
  • Constructor Details

    • Skill

      public Skill(String name, String type, Map<String,Object> params)
      Constructs a new Skill instance with the specified name, type, and parameters.
      Parameters:
      name - The name of the skill.
      type - The type of the skill.
      params - The parameters of the skill.
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • describe

      public String describe()
      Returns a string representation of the Skill object.
      Returns:
      A string representation of the Skill object.
    • fromJson

      public static Skill fromJson(com.google.gson.JsonObject json)
      Converts JSON data to a Skill object.
      Parameters:
      json - The JSON data to convert.
      Returns:
      The Skill object created from the JSON data.
    • createParams

      protected static Map<String,Object> createParams(String database, List<String> tables, String description)
      Creates parameters for a skill with the specified database, tables, and description.
      Parameters:
      database - The database name.
      tables - The list of table names.
      description - The description of the skill.
      Returns:
      The parameters for the skill.
    • setParams

      public void setParams(Map<String,Object> params)
      Update or set the parameters of the skill.
      Parameters:
      params - The parameters of the skill.