public class LambdaDelegate extends Object
FusionAuthClient
methods and automatically deals
with the ClientResponse
object for you.Modifier and Type | Field and Description |
---|---|
FusionAuthClient |
client |
java.util.function.Consumer<com.inversoft.rest.ClientResponse<?,?>> |
errorConsumer |
java.util.function.Function<com.inversoft.rest.ClientResponse<?,?>,?> |
successFunction |
Constructor and Description |
---|
LambdaDelegate(FusionAuthClient client,
java.util.function.Function<com.inversoft.rest.ClientResponse<?,?>,?> successFunction,
java.util.function.Consumer<com.inversoft.rest.ClientResponse<?,?>> errorConsumer) |
Modifier and Type | Method and Description |
---|---|
<T,U> T |
execute(java.util.function.Function<FusionAuthClient,com.inversoft.rest.ClientResponse<T,U>> function)
Executes the delegated FusionAuthClient call using the given function (to make the API call) and the function and
consumer passed into the constructor.
|
public final FusionAuthClient client
public final java.util.function.Consumer<com.inversoft.rest.ClientResponse<?,?>> errorConsumer
public final java.util.function.Function<com.inversoft.rest.ClientResponse<?,?>,?> successFunction
public LambdaDelegate(FusionAuthClient client, java.util.function.Function<com.inversoft.rest.ClientResponse<?,?>,?> successFunction, java.util.function.Consumer<com.inversoft.rest.ClientResponse<?,?>> errorConsumer)
public <T,U> T execute(java.util.function.Function<FusionAuthClient,com.inversoft.rest.ClientResponse<T,U>> function)
T
- The success response type.U
- The error response type.function
- The Function that should invoke the FusionAuthClient method.Copyright © 2021. All rights reserved.