Package com.mindee.v2.cli
Class BaseCommand
- java.lang.Object
-
- com.mindee.v2.cli.BaseCommand
-
- Direct Known Subclasses:
BaseInferenceCommand,SearchModelsCommand,SearchRagDocumentsCommand
public abstract class BaseCommand extends Object implements Callable<Integer>
Abstract base class for all V2 CLI commands. Handles common options and output formatting.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseCommand.OutputTypeOutput format for the command.
-
Field Summary
Fields Modifier and Type Field Description protected StringapiKeyprotected BaseCommand.OutputTypeoutput
-
Constructor Summary
Constructors Constructor Description BaseCommand()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract StringgetFullOutput(CommonResponse response)Returns the full string for the given response.protected abstract StringgetSummaryOutput(CommonResponse response)Returns the summary string for the given response.protected voidprintOutput(CommonResponse response)Prints the output to the console, taking into account the output type.
-
-
-
Field Detail
-
apiKey
protected String apiKey
-
output
protected BaseCommand.OutputType output
-
-
Method Detail
-
getSummaryOutput
protected abstract String getSummaryOutput(CommonResponse response)
Returns the summary string for the given response. Override in each command.- Parameters:
response- the response- Returns:
- the summary string
-
getFullOutput
protected abstract String getFullOutput(CommonResponse response)
Returns the full string for the given response.- Parameters:
response- the product response- Returns:
- the full output string
-
printOutput
protected void printOutput(CommonResponse response) throws Exception
Prints the output to the console, taking into account the output type.- Throws:
Exception
-
-