package com.crawler.command; import com.crawler.view.ConsoleView; public class ExitCommand implements Command { private final ConsoleView view; private Runnable exitCallback; public ExitCommand(ConsoleView view, Runnable exitCallback) { this.view = view; this.exitCallback = exitCallback; } @Override public void execute(String[] args) { view.displayGoodbye(); if (exitCallback != null) { exitCallback.run(); } } @Override public String getCommandName() { return "exit"; } @Override public String getDescription() { return "Exit the application"; } }