Class PersistentEntitiesResourceMappings
java.lang.Object
org.springframework.data.rest.core.mapping.PersistentEntitiesResourceMappings
- All Implemented Interfaces:
Iterable<ResourceMetadata>
,Supplier<Stream<ResourceMetadata>>
,ResourceMappings
,Streamable<ResourceMetadata>
- Direct Known Subclasses:
RepositoryResourceMappings
- Author:
- Oliver Gierke, Mark Paluch
-
Constructor Summary
ConstructorDescriptionCreates a newPersistentEntitiesResourceMappings
from the givenPersistentEntities
. -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addToCache
(Class<?> type, ResourceMetadata metadata) Adds the givenResourceMetadata
to the cache.boolean
exportsMappingFor
(Class<?> type) Returns whether we have aResourceMapping
for the given type and it is exported.boolean
Returns whether we export a top-level resource for the given path.getMappingFor
(PersistentProperty<?> property) getMetadataFor
(Class<?> type) Returns aResourceMetadata
for the given type if available.getSearchResourceMappings
(Class<?> domainType) Returns theResourceMapping
s for the search resources of the given type.boolean
hasMappingFor
(Class<?> type) Returns whether we have aResourceMapping
for the given type.protected final boolean
hasMetadataFor
(Class<?> type) Returns whether we currently already haveResourceMetadata
for the given type.boolean
isMapped
(PersistentProperty<?> property) iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PersistentEntitiesResourceMappings
Creates a newPersistentEntitiesResourceMappings
from the givenPersistentEntities
.- Parameters:
entities
- must not be null.
-
-
Method Details
-
getMetadataFor
Description copied from interface:ResourceMappings
Returns aResourceMetadata
for the given type if available.- Specified by:
getMetadataFor
in interfaceResourceMappings
- Parameters:
type
- must not be null.- Returns:
- the
ResourceMetadata
if available or null otherwise.
-
getSearchResourceMappings
Description copied from interface:ResourceMappings
Returns theResourceMapping
s for the search resources of the given type.- Specified by:
getSearchResourceMappings
in interfaceResourceMappings
- Parameters:
domainType
- must not be null.- Returns:
- will never be null.
-
exportsMappingFor
Description copied from interface:ResourceMappings
Returns whether we have aResourceMapping
for the given type and it is exported.- Specified by:
exportsMappingFor
in interfaceResourceMappings
- Returns:
-
exportsTopLevelResourceFor
Description copied from interface:ResourceMappings
Returns whether we export a top-level resource for the given path.- Specified by:
exportsTopLevelResourceFor
in interfaceResourceMappings
- Parameters:
path
- must not be null or empty.- Returns:
-
hasMappingFor
Description copied from interface:ResourceMappings
Returns whether we have aResourceMapping
for the given type.- Specified by:
hasMappingFor
in interfaceResourceMappings
- Parameters:
type
- must not be null.- Returns:
-
getMappingFor
-
isMapped
-
iterator
- Specified by:
iterator
in interfaceIterable<ResourceMetadata>
-
addToCache
Adds the givenResourceMetadata
to the cache.- Parameters:
type
- must not be null.metadata
- can be null.
-
hasMetadataFor
Returns whether we currently already haveResourceMetadata
for the given type.- Parameters:
type
- must not be null.- Returns:
-