Class ActorProxyBuilder<T>

java.lang.Object
io.dapr.actors.client.ActorProxyBuilder<T>

public class ActorProxyBuilder<T> extends Object
Builder to generate an ActorProxy instance. Builder can be reused for multiple instances.
  • Constructor Details

    • ActorProxyBuilder

      public ActorProxyBuilder(Class<T> actorTypeClass, ActorClient actorClient)
      Instantiates a new builder for a given Actor type, using DefaultObjectSerializer by default. DefaultObjectSerializer is not recommended for production scenarios.
      Parameters:
      actorTypeClass - Actor's type class.
      actorClient - Dapr's sidecar client for Actor APIs.
    • ActorProxyBuilder

      public ActorProxyBuilder(String actorType, Class<T> actorTypeClass, ActorClient actorClient)
      Instantiates a new builder for a given Actor type, using DefaultObjectSerializer by default. DefaultObjectSerializer is not recommended for production scenarios.
      Parameters:
      actorType - Actor's type.
      actorTypeClass - Actor's type class.
      actorClient - Dapr's sidecar client for Actor APIs.
  • Method Details

    • withObjectSerializer

      public ActorProxyBuilder<T> withObjectSerializer(DaprObjectSerializer objectSerializer)
      Instantiates a new builder for a given Actor type, using DefaultObjectSerializer.
      Parameters:
      objectSerializer - Serializer for objects sent/received.
      Returns:
      This instance.
    • build

      public T build(ActorId actorId)
      Instantiates a new ActorProxy.
      Parameters:
      actorId - Actor's identifier.
      Returns:
      New instance of ActorProxy.