Polish
This commit is contained in:
parent
23fc6f6b1d
commit
cd403f4180
|
|
@ -223,6 +223,7 @@ public class ResponseEntity<T> extends HttpEntity<T> {
|
|||
* @since 5.1
|
||||
*/
|
||||
public static <T> ResponseEntity<T> of(Optional<T> body) {
|
||||
Assert.notNull(body, "Body must not be null");
|
||||
return body.map(ResponseEntity::ok).orElse(notFound().build());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue