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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionemptyCollectionOf(Class<?> type) Creates anEmbeddedWrapperfor an emptyCollectionwith the given element type.Creates a newEmbeddedWrapperthatwrap(Object source, LinkRelation rel) Creates a newEmbeddedWrapperwith 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 newEmbeddedWrapperthat- Parameters:
source- must not be null.- Returns:
- will never be null.
-
emptyCollectionOf
Creates anEmbeddedWrapperfor an emptyCollectionwith the given element type.- Parameters:
type- must not be null.- Returns:
-
wrap
Creates a newEmbeddedWrapperwith the given rel.- Parameters:
source- must not be null.rel- must not be null or empty.- Returns:
- will never be null.
-