Package com.tnsai.llm
Record Class LLMResolver.ResolutionResult
java.lang.Object
java.lang.Record
com.tnsai.llm.LLMResolver.ResolutionResult
- Record Components:
llm- the resolved LLM client (may be null if source is NONE)source- where the LLM came from
- Enclosing class:
LLMResolver
public static record LLMResolver.ResolutionResult(LLMClient llm, LLMResolver.ResolutionSource source)
extends Record
Result of LLM resolution with source tracking.
-
Constructor Summary
ConstructorsConstructorDescriptionResolutionResult(LLMClient llm, LLMResolver.ResolutionSource source) Creates an instance of aResolutionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks if an LLM was found.llm()Returns the value of thellmrecord component.Gets the LLM or throws if none found.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
isPresent
public boolean isPresent()Checks if an LLM was found.- Returns:
- true if LLM is available
-
orThrow
Gets the LLM or throws if none found.- Parameters:
context- optional context for error message- Returns:
- the LLM client
- Throws:
IllegalStateException- if no LLM configured
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
llm
Returns the value of thellmrecord component.- Returns:
- the value of the
llmrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-