return forUpdate ? build.build() : build.forCreation();
private Resource<Object> toResource(Object value) { PersistentEntity<?, ?> entity = entities.getRequiredPersistentEntity(value.getClass()); return invoker.invokeProcessorsFor(PersistentEntityResource.build(value, entity).// withEmbedded(assembler.getEmbeddedResources(value)).// buildNested()); } }
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)); }
return forUpdate ? build.build() : build.forCreation();
/** * Returns the full object as {@link PersistentEntityResource} using the underlying {@link Projector}. * * @param instance must not be {@literal null}. * @return */ public PersistentEntityResource toFullResource(Object instance) { Assert.notNull(instance, "Entity instance must not be null!"); return wrap(projector.project(instance), instance).build(); }
@Override public PersistentEntityResource toResource(Object instance) { Assert.notNull(instance, "Entity instance must not be null!"); return wrap(projector.projectExcerpt(instance), instance).build(); }
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)); }
/** * Creates a new {@link Builder} to create {@link PersistentEntityResource}s eventually. * * @param content must not be {@literal null}. * @param entity must not be {@literal null}. * @return */ public static Builder build(Object content, PersistentEntity<?, ?> entity) { return new Builder(content, entity); }
private Resource<Object> toResource(Object value) { PersistentEntity<?, ?> entity = entities.getRequiredPersistentEntity(value.getClass()); return invoker.invokeProcessorsFor(PersistentEntityResource.build(value, entity).// withEmbedded(assembler.getEmbeddedResources(value)).// buildNested()); } }
/** * Returns the full object as {@link PersistentEntityResource} using the underlying {@link Projector}. * * @param instance must not be {@literal null}. * @return */ public PersistentEntityResource toFullResource(Object instance) { Assert.notNull(instance, "Entity instance must not be null!"); return wrap(projector.project(instance), instance).build(); }
@Override public PersistentEntityResource toResource(Object instance) { Assert.notNull(instance, "Entity instance must not be null!"); return wrap(projector.projectExcerpt(instance), instance).build(); }
/** * Creates a new {@link Builder} to create {@link PersistentEntityResource}s eventually. * * @param content must not be {@literal null}. * @param entity must not be {@literal null}. * @return */ public static Builder build(Object content, PersistentEntity<?, ?> entity) { return new Builder(content, entity); }