Last active
August 11, 2018 18:11
-
-
Save willianantunes/eb5a7eb0baea2c370282300d002fe556 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PostMapping(path = REQUEST_PATH_JASMINE, produces = APPLICATION_JSON_VALUE) | |
public ResponseEntity<?> jasmine(@RequestParam(HONEST_JASMINE_AJAX_PARAMETER) Optional<String> sample) throws InterruptedException { | |
var maybeEmptySample = sample.map(s -> s.isEmpty()? null : s); | |
LOGGER.info("Looking for {}", maybeEmptySample); | |
TimeUnit.SECONDS.sleep(2); | |
return ok(new Object() { | |
String message = "Pois é! Você estava procurando por " + maybeEmptySample.orElse("NADA") + " de fato!"; | |
public String getMessage() { | |
return message; | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment