src/main/java/io/vertx/todo/TodoApplication.java
/**
	 * @param routingContext
	 * <p>
	 * Method will read the request parameter for the "id" and will
	 * find the id in the map and update the todo as required. 
	 * 400(Bad Request) or 404(Not Found) as required.
	 * </p>
	 */
@param routingContext

Method will read the request parameter for the "id" and will
find the id in the map and update the todo as required.
@param routingContext Method will read the request parameter for the " id " and will find the id in the map and update the todo as required .
private void updateTodo(RoutingContext routingContext) {
		final String id = routingContext.request().getParam("id");
		final String newTask = routingContext.request().getParam("message");
		client.get(id, r -> {
			if (r.succeeded()) {
				if (r.result().length() > 0) {
					client.set(id, newTask, s -> {
						if (r.succeeded()) {
							routingContext.response().putHeader("content-type", "application/json; charset=utf-8")
									.end(Json.encodePrettily(new Todo(Integer.parseInt(id), newTask)));
						} else {
							System.out.println("Connection or Operation Failed " + r.cause());
						}
					});
				} else {
					routingContext.response().setStatusCode(404).end();
				}
			} else {
				System.out.println("Connection or Operation Failed " + r.cause());
			}
		});
	}
private void updateTodo ( RoutingContext routingContext ) { final String id = routingContext . request ( ) . getParam ( "id" ) ; final String newTask = routingContext . request ( ) . getParam ( "message" ) ; client . get ( id , r -> { if ( r . succeeded ( ) ) { if ( r . result ( ) . length ( ) > 0 ) { client . set ( id , newTask , s -> { if ( r . succeeded ( ) ) { routingContext . response ( ) . putHeader ( "content-type" , "application/json; charset=utf-8" ) . end ( Json . encodePrettily ( new Todo ( Integer . parseInt ( id ) , newTask ) ) ) ; } else { System . out . println ( "Connection or Operation Failed " + r . cause ( ) ) ; } } ) ; } else { routingContext . response ( ) . setStatusCode ( 404 ) . end ( ) ; } } else { System . out . println ( "Connection or Operation Failed " + r . cause ( ) ) ; } } ) ; }
@param routingContext
 <p>
 Method will read the request parameter for the "id" and will
 find the id in the map and update the todo as required.
@param routingContext <p > Method will read the request parameter for the " id " and will find the id in the map and update the todo as required .
// temp storing id and updated message for the task // getting the task and updating, message will overwritten since its // same key // setting the respons header and returning the todo // as a encoded json // sending the not found status // showing the error cause