Record Class Destination

java.lang.Object
java.lang.Record
com.axelor.ai.governance.access.Destination
Record Components:
model - the model's id, or null when none could be found
provider - its provider's id, or null when none could be found

public record Destination(Long model, Long provider) extends Record
Where data the AI reads goes: the model serving the call, and its provider — what a policy lists to hold data back from it.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Destination
    No model found: every policy listing a model or a provider applies, the least favourable destination.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Destination(Long model, Long provider)
    Creates an instance of a Destination record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    forTurn(String chosen, AiAgent agent)
    The destination of a turn: the model the user chose, else the agent's, else the default.
    final int
    Returns a hash code value for this object.
    Returns the value of the model record component.
    of(AiModel model)
    The model's destination, or UNKNOWN for none.
    Returns the value of the provider record component.
    final String
    Returns a string representation of this record class.
    boolean
    Whether no model was found.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • UNKNOWN

      public static final Destination UNKNOWN
      No model found: every policy listing a model or a provider applies, the least favourable destination.
  • Constructor Details

    • Destination

      public Destination(Long model, Long provider)
      Creates an instance of a Destination record class.
      Parameters:
      model - the value for the model record component
      provider - the value for the provider record component
  • Method Details

    • of

      public static Destination of(AiModel model)
      The model's destination, or UNKNOWN for none.
    • forTurn

      public static Destination forTurn(String chosen, AiAgent agent)
      The destination of a turn: the model the user chose, else the agent's, else the default.
    • unknown

      public boolean unknown()
      Whether no model was found.
    • 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.
    • model

      public Long model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • provider

      public Long provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component