public interface ResponseUtil
| Modifier and Type | Method and Description |
|---|---|
static <X> org.springframework.http.ResponseEntity<X> |
wrapOrNotFound(Optional<X> maybeResponse)
Wrap the optional into a
ResponseEntity with an HttpStatus.OK status, or if it's empty, it
returns a ResponseEntity with HttpStatus.NOT_FOUND. |
static <X> org.springframework.http.ResponseEntity<X> |
wrapOrNotFound(Optional<X> maybeResponse,
org.springframework.http.HttpHeaders header)
Wrap the optional into a
ResponseEntity with an HttpStatus.OK status with the headers, or if it's
empty, it returns a ResponseEntity with HttpStatus.NOT_FOUND. |
static <X> org.springframework.http.ResponseEntity<X> wrapOrNotFound(Optional<X> maybeResponse)
ResponseEntity with an HttpStatus.OK status, or if it's empty, it
returns a ResponseEntity with HttpStatus.NOT_FOUND.X - type of the responsemaybeResponse - response to return if presentmaybeResponse if present or HttpStatus.NOT_FOUNDstatic <X> org.springframework.http.ResponseEntity<X> wrapOrNotFound(Optional<X> maybeResponse, org.springframework.http.HttpHeaders header)
ResponseEntity with an HttpStatus.OK status with the headers, or if it's
empty, it returns a ResponseEntity with HttpStatus.NOT_FOUND.X - type of the responsemaybeResponse - response to return if presentheader - headers to be added to the responsemaybeResponse if present or HttpStatus.NOT_FOUNDCopyright © 2019 JHipster. All rights reserved.