/** * Sets the location header pointing to the resource representing the given instance. Will make sure we properly * expand the URI template potentially created as self link. * * @param headers must not be {@literal null}. * @param assembler must not be {@literal null}. * @param source must not be {@literal null}. */ private void addLocationHeader(HttpHeaders headers, PersistentEntityResourceAssembler assembler, Object source) { String selfLink = assembler.getSelfLinkFor(source).getHref(); headers.setLocation(new UriTemplate(selfLink).expand()); }
private Builder wrap(Object instance, Object source) { PersistentEntity<?, ?> entity = entities.getRequiredPersistentEntity(source.getClass()); return PersistentEntityResource.build(instance, entity).// withEmbedded(getEmbeddedResources(source)).// withLink(getSelfLinkFor(source)).// withLink(linkProvider.createSelfLinkFor(source)); }
/** * Sets the location header pointing to the resource representing the given instance. Will make sure we properly * expand the URI template potentially created as self link. * * @param headers must not be {@literal null}. * @param assembler must not be {@literal null}. * @param source must not be {@literal null}. */ private void addLocationHeader(HttpHeaders headers, PersistentEntityResourceAssembler assembler, Object source) { String selfLink = assembler.getSelfLinkFor(source).getHref(); headers.setLocation(new UriTemplate(selfLink).expand()); }
private Builder wrap(Object instance, Object source) { PersistentEntity<?, ?> entity = entities.getRequiredPersistentEntity(source.getClass()); return PersistentEntityResource.build(instance, entity).// withEmbedded(getEmbeddedResources(source)).// withLink(getSelfLinkFor(source)).// withLink(linkProvider.createSelfLinkFor(source)); }