diff --git a/tutorial/01-setup.md b/tutorial/01-setup.md index 9c1dcd94ca4..615fd684bc4 100644 --- a/tutorial/01-setup.md +++ b/tutorial/01-setup.md @@ -111,7 +111,7 @@ class CommandLineAtm { CommandRouter commandRouter = new CommandRouter(); while (scanner.hasNextLine()) { - Status unused = commandRouter.route(scanner.nextLine()); + Result unused = commandRouter.route(scanner.nextLine()); } } } diff --git a/tutorial/02-initial-dagger.md b/tutorial/02-initial-dagger.md index 0975b1d389b..f72ac3c1485 100644 --- a/tutorial/02-initial-dagger.md +++ b/tutorial/02-initial-dagger.md @@ -29,7 +29,7 @@ class CommandLineAtm { CommandRouter commandRouter = commandRouterFactory.router(); while (scanner.hasNextLine()) { - Status unused = commandRouter.route(scanner.nextLine()); + Result unused = commandRouter.route(scanner.nextLine()); } } } diff --git a/tutorial/14-avoiding-recursive-logins.md b/tutorial/14-avoiding-recursive-logins.md index 00bc75cc935..24e9a82a7d0 100644 --- a/tutorial/14-avoiding-recursive-logins.md +++ b/tutorial/14-avoiding-recursive-logins.md @@ -42,6 +42,10 @@ final class LoginCommand extends SingleArgCommand { if (account.isPresent()) { // Ignore "login " commands if we already have an account return Result.handled(); + } else { + Account account = database.getAccount(username); + UserCommandsRouter userCommands = userCommandsRouterFactory.create(account); + return Result.enterNestedCommandSet(userCommands.router()); } } } @@ -52,11 +56,11 @@ In order to tell Dagger how to supply this `Optional`, let's add a ```java @Module -interface LoginCommandModule { +abstract class LoginCommandModule { ... @BindsOptionalOf - Account optionalAccount(); + abstract Account optionalAccount(); } ```