Create copy for Affordances API

This commit is contained in:
Greg Turnquist
2017-12-05 12:27:19 -06:00
parent a128c72f6c
commit fe4a5923f8
2 changed files with 433 additions and 446 deletions

View File

@@ -46,10 +46,8 @@ class EmployeeResourceAssembler extends SimpleIdentifiableResourceAssembler<Empl
protected void addLinks(Resource<Employee> resource) {
resource.getContent().getId()
.ifPresent(id -> {
resource.add(getCollectionLinkBuilder().slash(resource.getContent()).withSelfRel()
.andAffordance(afford(methodOn(EmployeeController.class).updateEmployee(null, id))));
});
.ifPresent(id -> resource.add(getCollectionLinkBuilder().slash(resource.getContent()).withSelfRel()
.andAffordance(afford(methodOn(EmployeeController.class).updateEmployee(null, id)))));
resource.add(getCollectionLinkBuilder().withRel(this.getRelProvider().getCollectionResourceRelFor(this.getResourceType())));
}