Class EmbeddedWrappers
java.lang.Object
org.springframework.hateoas.server.core.EmbeddedWrappers
Interface to mark objects that are aware of the rel they'd like to be exposed under.
- Author:
- Oliver Gierke
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionemptyCollectionOf
(Class<?> type) Creates anEmbeddedWrapper
for an emptyCollection
with the given element type.Creates a newEmbeddedWrapper
thatwrap
(Object source, LinkRelation rel) Creates a newEmbeddedWrapper
with the given rel.
-
Constructor Details
-
EmbeddedWrappers
public EmbeddedWrappers(boolean preferCollections) Creates a newEmbeddedWrappers
.- Parameters:
preferCollections
- whether wrappers for single elements should rather treat the value as collection.
-
-
Method Details
-
wrap
Creates a newEmbeddedWrapper
that- Parameters:
source
- must not be null.- Returns:
- will never be null.
-
emptyCollectionOf
Creates anEmbeddedWrapper
for an emptyCollection
with the given element type.- Parameters:
type
- must not be null.- Returns:
-
wrap
Creates a newEmbeddedWrapper
with the given rel.- Parameters:
source
- must not be null.rel
- must not be null or empty.- Returns:
- will never be null.
-