public class Actor extends Object implements PerformsTasks, SkipNested, Agent
Modifier and Type | Class and Description |
---|---|
static class |
Actor.ErrorHandlingMode |
IN_THE_CURRENT_SESSION
Modifier and Type | Method and Description |
---|---|
<T extends Ability> |
abilityTo(Class<? extends T> doSomething) |
<ANSWER> ANSWER |
asksFor(Question<ANSWER> question) |
void |
assignDescriptionToActor(String description) |
void |
assignName(String name) |
protected void |
attemptsTo(Actor.ErrorHandlingMode mode,
Performable... tasks) |
void |
attemptsTo(Performable... tasks) |
void |
brief(Actor otherActor)
Add all the remembered items for the current actor to the other actor's memory
|
void |
can(Consequence<?>... consequences) |
<T extends Ability> |
can(T doSomething) |
Actor |
describedAs(String description) |
void |
entersTheScene()
A method used to declare that an actor is now the actor in the spotlight, without having them perform any tasks.
|
<T> T |
forget(String key) |
<T> T |
gaveAsThe(String key) |
<C> C |
getAbilityThatExtends(Class<C> extendedClass)
Return an ability that extends the given class.
|
String |
getDescription() |
String |
getId() |
String |
getName() |
String |
getNameOrPronoun() |
List<HasTeardown> |
getTeardowns()
Return a list of all
Ability s which implement HasTeardown |
void |
has(Fact... facts) |
void |
has(Performable... todos) |
static Actor |
named(String name) |
<T> T |
recall(String key) |
Map<String,Object> |
recallAll() |
void |
remember(String key,
Object value) |
<ANSWER> void |
remember(String key,
Question<ANSWER> question) |
<T> T |
sawAsThe(String key) |
void |
should(Consequence<?>... consequences) |
void |
should(List<Consequence<?>> consequences) |
void |
should(String groupStepName,
Consequence<?>... consequences) |
String |
toString() |
<T extends Ability> |
usingAbilityTo(Class<? extends T> doSomething)
A more readable way to access an actor's abilities.
|
Actor |
usingPronoun(String pronoun) |
void |
wasAbleTo(Performable... todos)
A tense-neutral synonym for addFact() for use with given() clauses
|
<T extends Ability> |
whoCan(T doSomething) |
Actor |
withNoPronoun() |
void |
wrapUp() |
public Actor(String name)
public void brief(Actor otherActor)
otherActor
- public String getDescription()
public String getNameOrPronoun()
public <C> C getAbilityThatExtends(Class<C> extendedClass)
C
- the matching Ability cast to extendedClass or null if none matchextendedClass
- the Interface class that we expect to findpublic List<HasTeardown> getTeardowns()
Ability
s which implement HasTeardown
public <T extends Ability> T usingAbilityTo(Class<? extends T> doSomething)
public final void entersTheScene()
public final void has(Performable... todos)
public final void has(Fact... facts)
public final void wasAbleTo(Performable... todos)
protected final void attemptsTo(Actor.ErrorHandlingMode mode, Performable... tasks)
public final void attemptsTo(Performable... tasks)
attemptsTo
in interface PerformsTasks
public <ANSWER> ANSWER asksFor(Question<ANSWER> question)
asksFor
in interface PerformsTasks
public final void can(Consequence<?>... consequences)
public final void should(String groupStepName, Consequence<?>... consequences)
public final void should(List<Consequence<?>> consequences)
public final void should(Consequence<?>... consequences)
public <T> T recall(String key)
public <T> T forget(String key)
public <T> T sawAsThe(String key)
public <T> T gaveAsThe(String key)
public Actor withNoPronoun()
public void assignDescriptionToActor(String description)
public void assignName(String name)
public void wrapUp()
Copyright © 2021. All rights reserved.