/** GET /environments/:id -> get the "id" environment. */ @RequestMapping( value = "/environments/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<Environment> getEnvironment(@PathVariable Long id) { log.debug("REST request to get Environment : {}", id); return Optional.ofNullable(environmentRepository.findOne(id)) .map(environment -> new ResponseEntity<>(environment, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); }