package au.id.zancanaro.javacheck.statem; public class CommandResult { private final State state; private final Throwable thrown; private CommandResult(State state, Throwable thrown) { this.state = state; this.thrown = thrown; } public State getState() { return state; } public boolean isFailed() { return thrown != null; } public Throwable getThrown() { return thrown; } public static CommandResult success(State state) { return new CommandResult<>(state, null); } public static CommandResult fail(State state, Throwable ex) { return new CommandResult<>(state, ex); } }