public class Prompt extends BusinessDomainObject
Business domain object (BDO) representing a prompt.

Wraps observable JavaFX properties for the prompt text, the associated SampleQuery, and the PromptType. Versioning is inherited from BusinessDomainObject and is automatically refreshed when observed properties change.

The toString() representation concatenates the names of the sample query and the prompt type.

Since:
1.0
Author:
Felix Seggebäing
  • Property Details

  • Constructor Details

    • Prompt

      public Prompt()
      Creates a new Prompt with default values.

      Initializes text as an empty string, sample query and type as null, and the version as null.

    • Prompt

      public Prompt(String text, SampleQuery sampleQuery, PromptType type)
      Creates a new Prompt with the given values.

      Sets the version to null, causing it to be initialized automatically.

      Parameters:
      text - non-null prompt text
      sampleQuery - optional related sample query
      type - optional prompt type
      Throws:
      NullPointerException - if text is null
    • Prompt

      public Prompt(String text, SampleQuery sampleQuery, PromptType type, Long version)
      Creates a new Prompt with the given values and an optional version.

      Initializes all fields and registers property listeners so that changes automatically refresh the version. If version is null, the version is initialized to the current time.

      Parameters:
      text - non-null prompt text
      sampleQuery - optional related sample query
      type - optional prompt type
      version - initial version value, or null to auto-generate
      Throws:
      NullPointerException - if text is null
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this prompt.

      Format: "<sampleQueryName> - <typeName>". If either reference is null, the string "null" is used in its place.

      Overrides:
      toString in class Object
      Returns:
      string representation of this prompt
    • getText

      public String getText()
      Gets the value of the text property.
      Property description:
      Returns:
      the value of the text property
      See Also:
    • textProperty

      public javafx.beans.property.StringProperty textProperty()
      Returns:
      the text property
      See Also:
    • getSampleQuery

      public SampleQuery getSampleQuery()
      Gets the value of the sampleQuery property.
      Property description:
      Returns:
      the value of the sampleQuery property
      See Also:
    • sampleQueryProperty

      public javafx.beans.property.ObjectProperty<SampleQuery> sampleQueryProperty()
      Returns:
      the sampleQuery property
      See Also:
    • getType

      public PromptType getType()
      Gets the value of the type property.
      Property description:
      Returns:
      the value of the type property
      See Also:
    • typeProperty

      public javafx.beans.property.ObjectProperty<PromptType> typeProperty()
      Returns:
      the type property
      See Also:
    • setText

      public void setText(String text)
      Sets the value of the text property.
      Property description:
      Parameters:
      text - the value for the text property
      See Also:
    • setSampleQuery

      public void setSampleQuery(SampleQuery sampleQuery)
      Sets the value of the sampleQuery property.
      Property description:
      Parameters:
      sampleQuery - the value for the sampleQuery property
      See Also:
    • setType

      public void setType(PromptType type)
      Sets the value of the type property.
      Property description:
      Parameters:
      type - the value for the type property
      See Also: