Fix some deprecation warnings

See gh-20108
This commit is contained in:
dreis2211
2020-02-09 09:37:12 +01:00
committed by Stephane Nicoll
parent ddcf5966bb
commit aa0360e1ba
9 changed files with 27 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import java.util.Map;
import org.springframework.hateoas.EntityModel;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.LinkRelation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -36,7 +37,7 @@ class HateoasController {
@RequestMapping("/resource")
EntityModel<Map<String, String>> resource() {
return new EntityModel<>(new HashMap<>(), new Link("self", "https://api.example.com"));
return EntityModel.of(new HashMap<>(), Link.of("self", LinkRelation.of("https://api.example.com")));
}
@RequestMapping("/plain")