Class CachingMappingDiscoverer
java.lang.Object
org.springframework.hateoas.server.core.CachingMappingDiscoverer
- All Implemented Interfaces:
MappingDiscoverer
Caching adapter of
MappingDiscoverer.- Author:
- Michal Stochmialek, Oliver Drotbohm, Réda Housni Alaoui
-
Method Summary
Modifier and TypeMethodDescriptionList<org.springframework.http.MediaType>getConsumes(Method method) Returns theMediaTypes supported for consumption.String[]Returns the statically declared request parameters.Collection<org.springframework.http.HttpMethod>getRequestMethod(Class<?> type, Method method) Returns the HTTP verbs for the givenMethodinvoked on the given type.@Nullable UriMappinggetUriMapping(Class<?> type) Returns the mapping associated with the given type.@Nullable UriMappinggetUriMapping(Class<?> type, Method method) Returns the mapping for the givenMethodinvoked on the given type.@Nullable UriMappinggetUriMapping(Method method) Returns the mapping associated with the givenMethod.static CachingMappingDiscovererof(MappingDiscoverer delegate)
-
Method Details
-
of
-
getUriMapping
Description copied from interface:MappingDiscovererReturns the mapping associated with the given type.- Specified by:
getUriMappingin interfaceMappingDiscoverer- Parameters:
type- must not be null.- Returns:
- the type-level mapping or null in case none is present.
-
getUriMapping
Description copied from interface:MappingDiscovererReturns the mapping associated with the givenMethod. This will include the type-level mapping.- Specified by:
getUriMappingin interfaceMappingDiscoverer- Parameters:
method- must not be null.- Returns:
- the method mapping including the type-level one or null if neither of them present.
-
getUriMapping
Description copied from interface:MappingDiscovererReturns the mapping for the givenMethodinvoked on the given type. This can be used to calculate the mapping for a super type method being invoked on a sub-type with a type mapping.- Specified by:
getUriMappingin interfaceMappingDiscoverer- Parameters:
type- must not be null.method- must not be null.- Returns:
- the method mapping including the type-level one or null if neither of them present.
-
getRequestMethod
public Collection<org.springframework.http.HttpMethod> getRequestMethod(Class<?> type, Method method) Description copied from interface:MappingDiscovererReturns the HTTP verbs for the givenMethodinvoked on the given type. This can be used to build hypermedia templates.- Specified by:
getRequestMethodin interfaceMappingDiscoverer- Returns:
-
getConsumes
Description copied from interface:MappingDiscovererReturns theMediaTypes supported for consumption.- Specified by:
getConsumesin interfaceMappingDiscoverer- Parameters:
method- must not be null.- Returns:
- can be null.
-
getParams
Description copied from interface:MappingDiscovererReturns the statically declared request parameters.- Specified by:
getParamsin interfaceMappingDiscoverer- Parameters:
method- must not be null.- Returns:
- the parameters of the mapped request, narrowing the primary mapping.
-