public final class Algorithm
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Algorithm.AlgorithmOptions |
static class |
Algorithm.AlgorithmOutputType |
Constructor and Description |
---|
Algorithm(HttpClient client,
AlgorithmRef algoRef) |
Algorithm(HttpClient client,
AlgorithmRef algoRef,
java.util.Map<java.lang.String,java.lang.String> options) |
Modifier and Type | Method and Description |
---|---|
AlgoResponse |
pipe(java.lang.Object input)
Calls the Algorithmia API for a given input.
|
FutureAlgoResponse |
pipeAsync(java.lang.Object input)
Calls the Algorithmia API asynchronously for a given input.
|
AlgoResponse |
pipeJson(java.lang.String inputJson)
Calls the Algorithmia API for given input that will be treated as JSON
|
FutureAlgoResponse |
pipeJsonAsync(java.lang.String inputJson)
Calls the Algorithmia API asynchronously for given input that will be treated as JSON
The future response will complete when the algorithm has completed or errored
|
Algorithm |
setOption(java.lang.String key,
java.lang.String value) |
Algorithm |
setOptions(java.util.Map<java.lang.String,java.lang.String> options) |
Algorithm |
setOutputType(Algorithm.AlgorithmOutputType outputType) |
Algorithm |
setStdout(boolean showStdout) |
Algorithm |
setTimeout(java.lang.Long timeout,
java.util.concurrent.TimeUnit unit) |
public Algorithm(HttpClient client, AlgorithmRef algoRef)
public Algorithm(HttpClient client, AlgorithmRef algoRef, java.util.Map<java.lang.String,java.lang.String> options)
public Algorithm setOptions(java.util.Map<java.lang.String,java.lang.String> options)
public Algorithm setOption(java.lang.String key, java.lang.String value)
public Algorithm setTimeout(java.lang.Long timeout, java.util.concurrent.TimeUnit unit)
public Algorithm setStdout(boolean showStdout)
public Algorithm setOutputType(Algorithm.AlgorithmOutputType outputType)
public AlgoResponse pipe(java.lang.Object input) throws APIException
input
- algorithm input, will automatically be converted into JSONAPIException
- if there is a problem communication with the Algorithmia API.public FutureAlgoResponse pipeAsync(java.lang.Object input)
input
- algorithm input, will automatically be converted into JSONpublic AlgoResponse pipeJson(java.lang.String inputJson) throws APIException
inputJson
- json input valueAPIException
- if there is a problem communication with the Algorithmia API.public FutureAlgoResponse pipeJsonAsync(java.lang.String inputJson)
inputJson
- json input value