Class BaseOutput
- java.lang.Object
-
- de.xima.fc.prompt.ms.impl.service.generic_oai.client.model.BaseOutput
-
- Direct Known Subclasses:
AskOutput,ListModelsOutput,TestConnectionOutput
public abstract class BaseOutput extends Object
Base class for outputs from API calls, with the ability to represent errors. Subclasses should add specific fields for successful outputs.- Since:
- 8.5.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseOutput()protectedBaseOutput(GenericOaiErrorType errorType, String errorMessage, Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThrowableerrorCause()Gets the exception that caused the error, if there was an error.StringerrorMessage()Gets the error message, if there was an error.GenericOaiErrorTypeerrorType()Gets the type of error, if there was an error.booleanhasError()Checks if the output represents an error.
-
-
-
Constructor Detail
-
BaseOutput
protected BaseOutput()
-
BaseOutput
protected BaseOutput(GenericOaiErrorType errorType, String errorMessage, Throwable cause)
-
-
Method Detail
-
errorCause
public final Throwable errorCause()
Gets the exception that caused the error, if there was an error.- Returns:
- The exception, or null if synthesis was successful.
-
errorMessage
public final String errorMessage()
Gets the error message, if there was an error.- Returns:
- The error message, or null if synthesis was successful.
-
errorType
public final GenericOaiErrorType errorType()
Gets the type of error, if there was an error.- Returns:
- The error type, or null if synthesis was successful.
-
hasError
public final boolean hasError()
Checks if the output represents an error.- Returns:
- true if there was an error, false otherwise.
-
-