/** * Builds the {@link CommandPortService}. * * @return A {@link CommandPortService}. */ public CommandPortService build() { if (!hasHelp) { final String helpString = helpStringBuilder.toString(); handlerBuilder.put("help", new CommandHandler() { @Override public void handle(BufferedWriter respondWriter) throws IOException { respondWriter.write(helpString); respondWriter.newLine(); } }); } return new CommandPortService(port, handlerBuilder.build()); } }
/** * Builds the {@link CommandPortService}. * * @return A {@link CommandPortService}. */ public CommandPortService build() { if (!hasHelp) { final String helpString = helpStringBuilder.toString(); handlerBuilder.put("help", new CommandHandler() { @Override public void handle(BufferedWriter respondWriter) throws IOException { respondWriter.write(helpString); respondWriter.newLine(); } }); } return new CommandPortService(port, handlerBuilder.build()); } }