All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.screenplay.questions.Remembered Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
package net.serenitybdd.screenplay.questions;

import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.annotations.Subject;

/**
 * A question that returns a value previously remembered by the actor.
 * @param 
 */
@Subject("#key")
public class Remembered implements Question {

    private final String key;

    private Remembered(String key) {
        this.key = key;
    }

    public static Remembered valueOf(String key) {
        return new Remembered(key);
    }

    @Override
    public T answeredBy(Actor actor) {
        return actor.recall(key);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy