Record Class QuestionAndAnswer
java.lang.Object
java.lang.Record
org.ek9lang.assist.QuestionAndAnswer
- Record Components:
id- Unique question identifier (e.g., 1, 2, 3)category- Category name (e.g., "Getting Started")question- The canonical question textalternatePhrasings- Alternative ways to ask the same questionanswer- The answer text (may contain markdown formatting)ek9Example- Inline EK9 code example or file referencemigrationContext- Which developer backgrounds find this relevantkeywords- Pre-tokenized keywords for matching (no stop words)
public record QuestionAndAnswer(int id, String category, String question, List<String> alternatePhrasings, String answer, String ek9Example, String migrationContext, Set<String> keywords)
extends Record
Holds a single Q&A entry for the EK9 knowledge base.
Used by the -q CLI for developer queries and -Q for training data export.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealternatePhrasingsrecord component.answer()Returns the value of theanswerrecord component.category()Returns the value of thecategoryrecord component.Returns the value of theek9Examplerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.keywords()Returns the value of thekeywordsrecord component.Returns the value of themigrationContextrecord component.question()Returns the value of thequestionrecord component.All searchable tokens: keywords plus tokenized alternate phrasings and migration context.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
QuestionAndAnswer
public QuestionAndAnswer(int id, String category, String question, List<String> alternatePhrasings, String answer, String ek9Example, String migrationContext, Set<String> keywords) Creates an instance of aQuestionAndAnswerrecord class.- Parameters:
id- the value for theidrecord componentcategory- the value for thecategoryrecord componentquestion- the value for thequestionrecord componentalternatePhrasings- the value for thealternatePhrasingsrecord componentanswer- the value for theanswerrecord componentek9Example- the value for theek9Examplerecord componentmigrationContext- the value for themigrationContextrecord componentkeywords- the value for thekeywordsrecord component
-
-
Method Details
-
searchableTokens
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
category
-
question
-
alternatePhrasings
Returns the value of thealternatePhrasingsrecord component.- Returns:
- the value of the
alternatePhrasingsrecord component
-
answer
-
ek9Example
Returns the value of theek9Examplerecord component.- Returns:
- the value of the
ek9Examplerecord component
-
migrationContext
Returns the value of themigrationContextrecord component.- Returns:
- the value of the
migrationContextrecord component
-
keywords
-