summaryrefslogtreecommitdiff
path: root/src/main/java/au/id/zancanaro/javacheck/statem/Command.java
blob: a741f0aae1e5cc85f13774e59fa7ecd96f5d15cb (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package au.id.zancanaro.javacheck.statem;

import au.id.zancanaro.javacheck.Generator;

public abstract class Command<State,Args,Result> {
    public Generator<Args> argsGenerator(State state) {
        return Generator.pure(null);
    }

    public boolean preCondition(State state, Args args) {
        return true;
    }

    public abstract Result runCommand(Args args);

    public State nextState(State state, Args args, CommandValue<Result> result) {
        return state;
    }

    public boolean postCondition(State oldState, State newState, Args args, Result result) {
        return true;
    }
}