BAEL-1178: changing variable type from String to Integer (#3700)

This commit is contained in:
Gurinder Singh 2018-03-01 05:51:14 +05:30 committed by KevinGilmore
parent 5c181c4b72
commit d9fddbde78
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ public class BasicMathController {
private RestTemplate restTemplate;
@GetMapping("/calculate")
public String checkOddAndEven(@RequestParam("number") String number) {
public String checkOddAndEven(@RequestParam("number") Integer number) {
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.add("Content-Type", "application/json");

View File

@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestController;
public class EvenOddController {
@GetMapping("/validate/prime-number")
public String isNumberPrime(@RequestParam("number") String number) {
return Integer.parseInt(number) % 2 == 0 ? "Even" : "Odd";
public String isNumberPrime(@RequestParam("number") Integer number) {
return number % 2 == 0 ? "Even" : "Odd";
}
}