Package io.dapr.actors.client

# 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 Summary

  Constructors
  Constructor
  Description
  `ActorProxyBuilder(Class<T> actorTypeClass, ActorClient actorClient)`
  Instantiates a new builder for a given Actor type, using `DefaultObjectSerializer` by default.
  `ActorProxyBuilder(String actorType, Class<T> actorTypeClass, ActorClient actorClient)`
  Instantiates a new builder for a given Actor type, using `DefaultObjectSerializer` by default.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `build(ActorId actorId)`
  Instantiates a new ActorProxy.
  `ActorProxyBuilder<T>`
  `withObjectSerializer(DaprObjectSerializer objectSerializer)`
  Instantiates a new builder for a given Actor type, using `DefaultObjectSerializer`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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.