Record Class DecisionRequest

java.lang.Object
java.lang.Record
ai.redouble.nucleo.harness.decision.DecisionRequest
Record Components:
state - what the questions are about; text, or a structure rendered as text
questions - the questions by id, at least one, in the order asked

public record DecisionRequest(Object state, Map<String,Question> questions) extends Record
One request to a decision model: a state and the questions to answer about it, each under an id the caller chose. The state is text, or a structure the wire renders as text (a map, a list, a plain object), and it is read once for every question in the request; the questions are answered independently of one another and the answers come back under the same ids. An id is the caller's handle: it keys the wire request and its answers, and the model is asked the question's instructions, nothing about the id.
Since:
0.1 (2026-09-24)
Author:
Andrey Santrosyan
  • Constructor Details

    • DecisionRequest

      public DecisionRequest(Object state, Map<String,Question> questions)
      Creates an instance of a DecisionRequest record class.
      Parameters:
      state - the value for the state record component
      questions - the value for the questions record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • state

      public Object state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • questions

      public Map<String,Question> questions()
      Returns the value of the questions record component.
      Returns:
      the value of the questions record component