Package io.dapr.client
Class DaprClientBuilder
java.lang.Object
io.dapr.client.DaprClientBuilder
public class DaprClientBuilder
extends java.lang.Object
A builder for the DaprClient,
Currently only and HTTP Client will be supported.
-
Constructor Summary
Constructors Constructor Description DaprClientBuilder()Creates a constructor for DaprClient. -
Method Summary
Modifier and Type Method Description DaprClientbuild()Build an instance of the Client based on the provided setup.DaprClientBuilderwithObjectSerializer(DaprObjectSerializer objectSerializer)Sets the serializer for objects to be sent and received from Dapr.DaprClientBuilderwithStateSerializer(DaprObjectSerializer stateSerializer)Sets the serializer for objects to be persisted.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DaprClientBuilder
public DaprClientBuilder()Creates a constructor for DaprClient.DefaultObjectSerializeris used for object and state serializers by defaul but is not recommended for production scenarios.
-
-
Method Details
-
withObjectSerializer
Sets the serializer for objects to be sent and received from Dapr. SeeDefaultObjectSerializeras possible serializer for non-production scenarios.- Parameters:
objectSerializer- Serializer for objects to be sent and received from Dapr.- Returns:
- This instance.
-
withStateSerializer
Sets the serializer for objects to be persisted. SeeDefaultObjectSerializeras possible serializer for non-production scenarios.- Parameters:
stateSerializer- Serializer for objects to be persisted.- Returns:
- This instance.
-
build
Build an instance of the Client based on the provided setup.- Returns:
- an instance of the setup Client
- Throws:
java.lang.IllegalStateException- if any required field is missing
-