public final class CoreStitchAppClient extends Object
| Constructor and Description |
|---|
CoreStitchAppClient(StitchAuthRequestClient authRequestClient,
StitchAppRoutes routes,
CodecRegistry codecRegistry)
Constructs a new app client.
|
| Modifier and Type | Method and Description |
|---|---|
void |
callFunction(String name,
List<?> args,
Long requestTimeout)
Calls the specified Stitch function.
|
<T> T |
callFunction(String name,
List<?> args,
Long requestTimeout,
Class<T> resultClass)
Calls the specified Stitch function, and decodes the response into an instance of the specified
type.
|
<T> T |
callFunction(String name,
List<?> args,
Long requestTimeout,
Class<T> resultClass,
CodecRegistry codecRegistry)
Calls the specified Stitch function, and decodes the response into an instance of the specified
type.
|
<T> T |
callFunction(String name,
List<?> args,
Long requestTimeout,
Decoder<T> decoder)
Calls the specified Stitch function, and decodes the response into a value using the provided
Decoder. |
public CoreStitchAppClient(StitchAuthRequestClient authRequestClient, StitchAppRoutes routes, CodecRegistry codecRegistry)
authRequestClient - the request client to used for authenticated requests.routes - the app specific routes.codecRegistry - the codec registry used for de/serialization.public void callFunction(String name, List<?> args, @Nullable Long requestTimeout)
name - the name of the Stitch function to call.args - the arguments to pass to the Stitch function.requestTimeout - the number of milliseconds the client should wait for a response from the
server before failing with an error.public <T> T callFunction(String name, List<?> args, @Nullable Long requestTimeout, Decoder<T> decoder)
Decoder.T - the type into which the Stitch response will be decoded.name - the name of the Stitch function to call.args - the arguments to pass to the Stitch function.requestTimeout - the number of milliseconds the client should wait for a response from the
server before failing with an error.decoder - the Decoder to use to decode the Stitch response into a value.public <T> T callFunction(String name, List<?> args, @Nullable Long requestTimeout, Class<T> resultClass)
T - the type into which the Stitch response will be decoded.name - the name of the Stitch function to call.args - the arguments to pass to the Stitch function.requestTimeout - the number of milliseconds the client should wait for a response from the
server before failing with an error.resultClass - the class that the Stitch response should be decoded as.public <T> T callFunction(String name, List<?> args, @Nullable Long requestTimeout, Class<T> resultClass, CodecRegistry codecRegistry)
T - the type into which the Stitch response will be decoded.name - the name of the Stitch function to call.args - the arguments to pass to the Stitch function.requestTimeout - the number of milliseconds the client should wait for a response from the
server before failing with an error.resultClass - the class that the Stitch response should be decoded as.codecRegistry - the codec registry that will be used to encode/decode the function call.