Package co.paralleluniverse.actors
Class ActorSpec<T extends Actor<Message,V>,Message,V>
- java.lang.Object
-
- co.paralleluniverse.actors.ActorSpec<T,Message,V>
-
- All Implemented Interfaces:
ActorBuilder<Message,V>
public class ActorSpec<T extends Actor<Message,V>,Message,V> extends java.lang.Object implements ActorBuilder<Message,V>
A specification of how to construct an actor
-
-
Constructor Summary
Constructors Constructor Description ActorSpec(java.lang.Class<T> type, java.lang.Object[] params)
Specifies an actor of a given type and given constructor parameters.ActorSpec(java.lang.reflect.Constructor<T> ctor, java.lang.Object[] params)
Specifies an actor with given constructor and given constructor parameters.ActorSpec(java.lang.String className, java.lang.Object[] params)
Specifies an actor of a given type and given constructor parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
build()
Constructs a new actorstatic <Message,V,T extends Actor<Message,V>>
ActorSpec<T,Message,V>of(com.google.common.reflect.TypeToken<T> type, java.lang.Object... params)
Creates anActorSpec
static <Message,V,T extends Actor<Message,V>>
ActorSpec<T,Message,V>of(java.lang.Class<T> type, java.lang.Object... params)
Creates anActorSpec
java.lang.String
toString()
-
-
-
Constructor Detail
-
ActorSpec
public ActorSpec(java.lang.String className, java.lang.Object[] params)
Specifies an actor of a given type and given constructor parameters.- Parameters:
className
- the name of the actor classparams
- the parameters to pass to the actor's constructors
-
ActorSpec
public ActorSpec(java.lang.Class<T> type, java.lang.Object[] params)
Specifies an actor of a given type and given constructor parameters.- Parameters:
type
- the type of the actorparams
- the parameters to pass to the actor's constructors
-
ActorSpec
public ActorSpec(java.lang.reflect.Constructor<T> ctor, java.lang.Object[] params)
Specifies an actor with given constructor and given constructor parameters.- Parameters:
ctor
- the actor's constructorparams
- the parameters to pass to the actor's constructors
-
-
Method Detail
-
of
public static <Message,V,T extends Actor<Message,V>> ActorSpec<T,Message,V> of(java.lang.Class<T> type, java.lang.Object... params)
Creates anActorSpec
- Parameters:
type
- the actor's typeparams
- the actor's constructor parameters.
-
of
public static <Message,V,T extends Actor<Message,V>> ActorSpec<T,Message,V> of(com.google.common.reflect.TypeToken<T> type, java.lang.Object... params)
Creates anActorSpec
- Parameters:
type
- the actor's typeparams
- the actor's constructor parameters.
-
build
public T build()
Description copied from interface:ActorBuilder
Constructs a new actor
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-