package Server.Automaton;

public class ActionResult {
    private final boolean success;
    private final String  errorMessage; // null se success

    private ActionResult(boolean success, String errorMessage) {
        this.success      = success;
        this.errorMessage = errorMessage;
    }

    public static ActionResult ok() {
        return new ActionResult(true, null);
    }

    public static ActionResult failure(String message) {
        return new ActionResult(false, message);
    }

    public boolean isSuccess()      { return success; }
    public String  getErrorMessage(){ return errorMessage; }
}