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