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

net.serenitybdd.screenplay.questions.TheMemory 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;

public class TheMemory implements Question {
    private final String memoryKey;

    public TheMemory(String memoryKey) {
        this.memoryKey = memoryKey;
    }

    @Override
    public Boolean answeredBy(Actor actor) {
        return actor.recall(memoryKey) != null;
    }

    public static class TheMemoryQuestionBuilder {

        private final String memoryKey;

        public TheMemoryQuestionBuilder(String memoryKey) {
            this.memoryKey = memoryKey;
        }

        public TheMemory isPresent() {
            return new TheMemory(memoryKey);
        }
    }

    public static TheMemoryQuestionBuilder withKey(String memoryKey) {
        return new TheMemoryQuestionBuilder(memoryKey);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy